Deleting folders
Posted: 13 Jun 2018 04:26
Hi gang,
I am trying to delete folders with wildcards within the "wstemp" directory the folders are all named "anonymous" with different end dates like "anonymous20180613" I want them all deleted when this script is run for the past 180 days / 6 months, I have attached what I have, I have tried numerous things but I keep missing something.
I am trying to delete folders with wildcards within the "wstemp" directory the folders are all named "anonymous" with different end dates like "anonymous20180613" I want them all deleted when this script is run for the past 180 days / 6 months, I have attached what I have, I have tried numerous things but I keep missing something.
Code: Select all
@ECHO OFF
ECHO Backing up wstemp
xcopy /i wstemp wstemp.backup /e
ECHO Deleting anonymous files in wstemp...
ECHO OFF
timeout 3
RMDIR E:\Dmgr01\wstemp\anonymous* (THIS IS THE LINE THAT ISN'T WORKING PROPERLY)
ECHO Deleting backup...
ECHO OFF
timeout 3
rmdir /s /q wstemp.backup
@ECHO OFF