Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
deleting folders - use batch prog
Name: carrac89 Date: January 15, 2005 at 21:13:29 Pacific OS: NT / XP CPU/Ram: P4 - 1gig
Comment:
I am trying to delete dated folders with files in them from under the main folder, but keep the most recent dated folder. I have bits and pieces of this, but end up deleting all folders, can someone assist
Name: Mechanix2Go Date: January 15, 2005 at 22:02:47 Pacific
Reply:
Take a look at:
for /?
There are many options to, for instance,
%~tI - expands %I to date/time of file
With that, you can do arithmetic manipulation.
Ask for more detail if needed.
HTH
M2
0
Response Number 2
Name: carrac89 Date: January 15, 2005 at 22:26:53 Pacific
Reply:
Thanks for the information - I am not really familiar with the FOR commands. I have used the "DELETE" command to remove files so many days old, but I also delete the folders with it. ex: "delete /r c:\amex" - will delete everything under amex, but "delete /d7 c:\amex" will delete files 7 days old, but will leave empty folders. I am trying to automate this as well. I will look into the FOR commands - I really appreciate the feedback..
CLP
0
Response Number 3
Name: Mechanix2Go Date: January 15, 2005 at 23:16:30 Pacific
Reply:
CLP,
Now I'm intrigued.
I typed in:
del /?
to see if there was a /D switch. {w2k]
There isn't
So I typed delete. There's no such command in w2k.
So, what OS are you using?
M2
0
Response Number 4
Name: BlueRaja Date: January 16, 2005 at 01:31:36 Pacific
Reply:
In windows, you use deltree to delete folders (or rmdir, if the folder has already been emptied)
BlueRaja.admin@gmail.com
0
Response Number 5
Name: Mechanix2Go Date: January 16, 2005 at 01:59:22 Pacific
Reply:
BlueRaja,
Yes, but no built-in way to selte by date/age.
M2
0
Response Number 6
Name: carrac89 Date: January 16, 2005 at 08:46:30 Pacific
Reply:
Mechanix2Go
Its a program I found in this web site: http://www.bykeyword.com/downloads/software-3/download-3033.html
Its really nice program and its simple, but all I need to do is add another line that would delete empty folders for my batch program I am creating.
BlueRaja I know about RMDIR and DELTREE, but I can't automate that command to run without user intervention.
CLP
0
Response Number 7
Name: Mechanix2Go Date: January 16, 2005 at 21:25:49 Pacific
Reply:
If you want to delete empty folders without user input, just:
Summary: Hi, I have to rename all the files in a particular folder using Batch programming. I am able to rename it only one file and the other files gets ignored. Could some one help me with the code ? FOR...
Summary: This is an example of a batch file I am using right now. I need it to delete subfolders in the folders. It already deletes everything else, just not folders. I am not sure what extra code lines I n...