Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
modify bat file to delete directory
Name: Zoltar Date: December 13, 2007 at 11:48:28 Pacific OS: XP Pro SP2 CPU/Ram: p4 3GHz / 1.24 G Product: Dell
Comment:
Trying to modify a bat file to delete an existing directory and its contents - then recreate the directory and perform a back up.
The latter part works, but now that the directory exists, subsequent backups fail.
It seemed best to just do the blurb - if exists path\directory - del path\directory prior to mkdir and doing the backup.
What I want to know is will such a command as If exists path\directory will work recursively down the tree of that directory killing off everything below it, so that when mkdir is executed that it will in fact create the then not existing directory and move forward with the remainder of the script.
Name: IVO Date: December 13, 2007 at 11:55:36 Pacific
Reply:
if exist path\directory RD path\directory /Q /S
0
Response Number 2
Name: wanderer Date: December 13, 2007 at 12:10:38 Pacific
Reply:
delete than backup????
Is this part of a backup script for log files? If so you should be renaming not deleting.
Imagine the power if you knew how to internet search
0
Response Number 3
Name: Zoltar Date: December 13, 2007 at 13:29:37 Pacific
Reply:
IVO - ok, thanks will try the if exist changes you offered.
wanderer - yes deleting directory before making backup copy.
This bat file is to backup Eudora mailboxes from local machine to network drive where user has limited space.
If needed the network files are backed up each work night.
Zoltar
0
Response Number 4
Name: Mechanix2Go Date: December 13, 2007 at 15:31:54 Pacific
Reply:
I don't much see a point in deleting then recreating DIRs.
Why not just delete the file?
del /s x:\the\stuff
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 5
Name: wanderer Date: December 13, 2007 at 19:21:17 Pacific
Reply:
Actually I used to keep a couple of weeks worth of logs to review by just renaming the previous folder and making a new one. I would just look at the date on the folder to know what days log it contained.
Are you ready for where Microsoft wants you to go today?
Summary: I hope I can explain this clear enough.. I am trying to get another bat file to run if any file in a certain folder has been modified today. So basically , if "c:\*.doc" was modified today then run "m...
Summary: Hi, I have to submit a UPS manifest every day which requires a long TXT full of shipping information to be sent to them. The old computer I was using had a special program to do it, but my new one jus...