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
linux php XSLT installation
Placing a Google Gadget or anything similiar, within a full flash website.
Export appointment to Outlook calendar?
How to create scheduled job using Query Analyzer
Delete with subquery
How to copy multiple charts from excel in word
Excel Multiple IF and AVERAGE Calculation
SEO Technique - Is this going to end up in my site getting penalised?
Difference between .Value and Value2
Metafile Logo indicates file attachment in XP Pro Outlook 2003.