Go Back   PCMech Forums > Windows Support > Windows Legacy Support (XP and earlier)

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 07-08-2004, 08:13 PM   #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.
wantabe2 is offline   Reply With Quote
Old 07-09-2004, 10:19 AM   #2
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
Try this:

xcopy "C:\Documents and Settings\MY MACHINE\My Documents\*.*" "Q:\MATERIALS" /e /c /i /h /k /y
doctorgonzo is offline   Reply With Quote
Old 07-09-2004, 01:32 PM   #3
Member (7 bit)
 
Join Date: Apr 2004
Posts: 70
Talking

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?
wantabe2 is offline   Reply With Quote
Old 07-09-2004, 01:38 PM   #4
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
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.
doctorgonzo is offline   Reply With Quote
Old 07-09-2004, 01:40 PM   #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.
wantabe2 is offline   Reply With Quote
Old 07-09-2004, 01:42 PM   #6
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
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.
doctorgonzo is offline   Reply With Quote
Old 07-09-2004, 01:45 PM   #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
wantabe2 is offline   Reply With Quote
Old 07-09-2004, 01:53 PM   #8
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
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.
doctorgonzo is offline   Reply With Quote
Old 07-09-2004, 02:07 PM   #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
wantabe2 is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:24 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2