I have a directory that contains .exe executable and required input files.
For each individual request, a separate directory (of the format Output_) is created in the same path and the respective output files are directed there.
Now i am in need of purging the older output directories. Can somebody explain how to achieve this in windows. I went through the forfiles documentation and other stack overflow answers but did not find any information on providing name pattern for folders that need to be deleted although this option is available for file deletion.
I am trying the below code. But i want to specify the folder pattern as well so that i do not delete other files.
forfiles /p "C:\work\Analysis\" /d +7 /c "cmd /c IF @isdir == TRUE rd /S /Q @path"