I am attempting to do the following:
I have a user who has a folder called c:\temp
now in c:\temp there are subfolders
the subfolders are completely random names
what the user wants to do is have me create a batch file that deletes everything in c:\temp BUT always retains the last folder
(the folders are dates, so lets say 02-12-01 then 02-12-02 and so on so forth)
Now I created a script file like this
rmdir c:\temp /s/q mkdir c:\temp
It does what it is supposed to do it silently deletes everything and then remakes c:\temp
Is there any other switch I can put to make it omit a folder without any user intervention?
As far as I know a batch file can't do that but maybe someone can point me in the right direction?
Maybe another program that does it for you? Or another kind of batch file?
Keep in mind 02-12-01 and so on is completely made up I don't know what the names of the folders will be they are random.
Thanks!
This post has been edited by anthonyaudi: 01 February 2012 - 02:52 PM



Help

Back to top










