/build/static/layout/Breadcrumb_cap_w.png

Scripting Help

I was able to run the script below but doesn't remove any directories I know I am missing something for the directories?

REM Remove files older than 14 days
forfiles -p "M:\14DAYTEMP" /q /s /m *.* /c "cmd /c Del @path" d- 14
forfiles /p "M:\14DAYTEMP" /s /m *.* /c "cmd /c  if @ISDIR== TRUE RD /q @FILE &RD /Q /S @FILE" d- 14

0 Comments   [ + ] Show comments

Answers (3)

Posted by: stevobasquez 9 years ago
Senior White Belt
1
What do you mean by practice I am able to remove any files within the directories but no the directories/folders themselves?

Thank you.
Posted by: EdT 9 years ago
Red Belt
1
After deleting the files in a directory, you need to make sure that the current directory in your code is not the directory you are trying to remove. You cannot delete a directory that is held locked by ANY other process.
Posted by: EdT 9 years ago
Red Belt
0
If the directory is not empty then it cannot be deleted. Have you checked for this in practice?
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ