Unsolved
This post is more than 5 years old
2 Posts
0
8060
May 26th, 2005 00:00
Writing a Batch file in Windows XP
I am running windows xp. I have a folder titled DMEVI6 that resides on my E Drive. Inside that folder are six subfolders. I want to be able to go to the RUN menu and have a batch file run that will copy the DMEVI6 folder and all its subfolders to my D Drive. How do I write the batch file? I also want it to automatically overwrite a previous session.
No Events found!



rickmktg
2 Intern
•
11.9K Posts
0
May 26th, 2005 01:00
Use Notepad to create a .BAT file. Put in it the commands as follows:
e:
cd .\dmev16
copy *.* d:\dmev16
cd .\NAME OF SUBFOLDER
copy *.* d:\dmev16\NAME OF SUBFOLDER
and so on, switching back to the dmev16 directory then to a sub folder...
Then use Scheduled Tasks to run the folder when you want to.
I fixed a typo from *.8 to *.*. Also, you should execute any proposed commands in Command Prompt, line by line, writing down EXACTLY what you do, to make sure each line works exactly as intended, then create the batch file, then verify it's outcome.
Message Edited by rickmktg on 05-26-2005 07:39 AM
Message Edited by rickmktg on 05-26-2005 09:32 AM
msgale
2 Intern
•
2.5K Posts
0
May 26th, 2005 03:00
WARNING there is an error in the above batch file. the line
"copy *.8 d:\dmev16\NAME OF SUBFOLDER"
is incorrect it probably should be
copy *.* d:\dmev16\NAME OF SUBFOLDER
Message Edited by msgale on 05-26-2005 01:48 AM
Message Edited by msgale on 05-26-2005 01:52 AM
jwatt
4.4K Posts
0
May 26th, 2005 04:00
Jim
msgale
2 Intern
•
2.5K Posts
0
May 26th, 2005 09:00
rickmktg
2 Intern
•
11.9K Posts
0
May 26th, 2005 10:00
Fixed the typo, what's wrong with the logic? I use files like this all the time, just put one in yesterday on a machine that's copying partition M to D via Ghost, then copying the Ghost file to a DVD-RW after erasing the contents of the DVD.
Any file should be executed, line by line, in Command Prompt, to confirm the exact instructions. I added that caveat to my post.
pijai
35 Posts
0
May 26th, 2005 12:00
e:
cd .\dmev16
copy *. * d:\dmev16
cd .\NAME OF SUBFOLDER
copy *.* d:\dmev16\NAME OF SUBFOLDER
and so on, switching back to the dmev16 directory then to a sub folder...
i might be seeing things . . . but did i notice another incident of incorrect syntax . . . the blank space between the period and asterisk . . . and this was after rickmktg corrected the code ?
copy *. * d:\dmev16
should be :
copy *.* d:\dmev16
rickmktg
2 Intern
•
11.9K Posts
0
May 26th, 2005 12:00
chuket
1.4K Posts
0
May 27th, 2005 01:00
cd dmev16
Message Edited by chuket on 05-26-2005 11:00 PM