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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xcopy and passwords

Status
Not open for further replies.

rickict

IS-IT--Management
Apr 29, 2005
18
GB
hi im trying to do a mass xcopy of shares off a server to a client using xcopy.
this is a small example of my .bat file:
Code:
xcopy /S \\cachepilot\aada01\ D:\backup\aada01\
xcopy /S \\cachepilot\aald01\ D:\backup\aald01\
xcopy /S \\cachepilot\abag01\ D:\backup\abag01\
xcopy /S \\cachepilot\abal01\ D:\backup\abal01\
xcopy /S \\cachepilot\abar01\ D:\backup\abar01\
xcopy /S \\cachepilot\abar02\ D:\backup\abar02\
xcopy /S \\cachepilot\abar03\ D:\backup\abar03\
xcopy /S \\cachepilot\abat01\ D:\backup\abat01\

the problem is each share has a password (they all have the same password though)but i get the error: bad path ,specified password not correct.
how can i stipulate the password along with my xcopy
command ,
any help would be great.thanks
 
use the "net use" command to map a drive letter to the share(s), passing id and password parameters in the command line first. then perform the copy operations. might also be a good idea to modify the batch file to use the drive letter as opposed to unc path. you need to test that.

in other words:
net use L: \\cachepilot\aada01\ /user:username password (i believe this is the correct syntax but not sure - need to test at a command prompt)
xcopy (etc.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top