Microsoft
Software
Hardware
Network
Question : delete file and copy new file
Hey all...
I am trying to run a batch script from a thumb drive that deletes a folder on the C:\ drive and copies a folder from the thumb drive to the c:\
It works fine when I am copying a folder with only a few files, so I guess I need it to wait for the folder to finish copying the files before exit.
here is what I have... I am using three .bat files
deleteold.bat to delete the folder on the c drive
code:
rd /s /q "C:\My Folder"
exit
copynew.bat to copy the new folder to the c drive
code:
xCOPY ..\My Folder\My Folder C:\My Folder\ /e /i
exit
and i am running them thru a combine.bat
code:
start /wait deleteold.bat
echo OLD FILES DELETED
start /wait copynew.bat
exit
I am new to batch files so I am trying to keep it simple at first
the folder I am deleteing contains about 500MB
the folder I am copying contains about 450MB
How do I get the batch file to finish deleting old folder before it starts copying new folder &
How do I get batch file copying the new folder to wait until it finishes the copying before exiting
Answer : delete file and copy new file
:deleteold.bat
rd /s /q "C:\My Folder"
:copynew.bat
xcopy "..\My Folder\My Folder" "C:\My Folder\" /e /i
:combine.bat
call deleteold.bat
echo OLD FILES DELETED
call copynew.bat
exit
Random Solutions
RPC over HTTP - "Outllook Anywhere" not connecting to server
Qt How do I have one form load another?
Scroll Bar on Dynamic Text Box
2003 server preparing network connections
Sed in a while read loop wont replace pattern stored in a variable
Find out Exchange 2007 MailBox size through outlook 2003/2007
Outlook 2000 Message Body Truncated. Windows 98.
What is blocking user internet access?
Group policy: Lockout policy and quota policy question
XP Pro - I used Linux to reset my windows password, now I can't connect to internet