Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XCOPY across network shares in W7 1

Status
Not open for further replies.

danno74

IS-IT--Management
Nov 13, 2002
295
US
Greetings!

I am setting up an installer, and with XP we used the following syntax to copy settings folders and files to the local computer(%APPDATA%) from a network drive(%INSTALLERDIR%):

XCOPY /Q /Y /E "%INSTALLERDIR%\Prefs\Application Data\*" "%APPDATA%\" >NUL

When I try to execute this command, I get a parse error. I have verified on the cmd line that both folders are accessible without error.

Any ideas? A coworker suggested that I try to copy it to another local folder and then move it from there as it may be a permission issue with W7, but I tried to save it to my desktop and the root folder and neither worked.

Thanks for any help you can offer!

- Dan
 
Googled xcopy and it states that the /E is to be used with /S or /T.

That could be your issue.
 
Hi Dan

How about:

Code:
XCOPY /Q /Y /E "%INSTALLERDIR%"\Prefs\"Application Data"\*.*  "%APPDATA%"\ >NUL

ie Quotes around installerdir in case it contains spaces
Quotes around Application Data because it does
Quotes around appdata in case it contains spaces.

Jock
 
Try the following instead:
Code:
XCOPY "%INSTALLERDIR%\Prefs\Application Data\*" "%APPDATA%\" /Q /Y /S /E /H

more info on the XCOPY switches and syntax:



or better yet, use ROBOCOPY:

Code:
robocopy "%INSTALLERDIR%\Prefs\Application Data\*" "%APPDATA%\" /e

see:
Ben
"If it works don't fix it! If it doesn't use a sledgehammer..."
How to ask a question, when posting them to a professional forum.
Only ask questions with yes/no answers if you want "yes" or "no"
 
Agreed - robocopy is a much better program, particularly over network shares as it has much better error recovery and also gives useful stats at eoj.

Jock
 
Thanks a ton for all the replies. Robocopy is awesome! The stats are most helpful with troubleshooting, I can't believe we never used this.

Turns out my problem was a typo in a set variable :( Damn quotes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top