|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (7 bit)
Join Date: Apr 2004
Posts: 70
|
DOS Copy Command Question
I need to copy "MY DOCUMENTS" folder & all contents on my local computer to a network share that is called Q:\materials
Is it poss. for me to do this? I tried by going to notepad & typing it in as follows. It is coming from an XP Pro computer. COPY C:\Documents and Settings\MY MACHINE\My Documents Q:\MATERIALS I then saved it as a batch file so I could put it on my desktop & back it up everyday & it would not work. My goal is to save everything in MY DOCUMENTS to another drive. Any advice would be appreciated. |
|
|
|
|
|
#2 |
|
Professional gadfly
|
Try this:
xcopy "C:\Documents and Settings\MY MACHINE\My Documents\*.*" "Q:\MATERIALS" /e /c /i /h /k /y |
|
|
|
|
|
#3 |
|
Member (7 bit)
Join Date: Apr 2004
Posts: 70
|
xcopy mydocu~1 Q:\materials\rustylaptopfiles /d /y /s /e
The above code is the exact code I need in a batch file. It works great from a DOS prompt. How could I make this work in a batch file? |
|
|
|
|
|
#4 |
|
Professional gadfly
|
All you have to do is open a new text file in Notepad, paste that line into the file, and save the file with a .BAT extension.
|
|
|
|
|
|
#5 |
|
Member (7 bit)
Join Date: Apr 2004
Posts: 70
|
I tried that & when I click on the .bat file, nothing happens. A black screen popps up & goes away so quick I can't see what it is. But it doesn not do what I want it to do although, I type it in a DOS prompt, it works.
|
|
|
|
|
|
#6 |
|
Professional gadfly
|
On the line after the xcopy command, add "PAUSE" (without the quotes). That way, the command line will stay up until you hit a key so you can at least read what happens. Since you are using the /d flag, it may not have anything to copy. Or there may be some other error message.
|
|
|
|
|
|
#7 |
|
Member (7 bit)
Join Date: Apr 2004
Posts: 70
|
It says that the DOCUME~1 file not found. It works fine from a regular DOS prompt though. I am confused
|
|
|
|
|
|
#8 |
|
Professional gadfly
|
You have to fully qualify the path. It may work when you open a DOS prompt because you are already in your My Documents folder, but from a batch file it won't.
Instead of DOCUME~1, use the full path like in my example. If there are spaces in the path name, use quotes around it. |
|
|
|
|
|
#9 |
|
Member (7 bit)
Join Date: Apr 2004
Posts: 70
|
You are a lifesaver!!!It works fine now. I really appreciate it. Have a good & safe weekend. Thanks again
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|