xcopy failing to copy files from remote servers
Hi all, I copied below script into "test.cmd" file and I trying to run from SQL Server Agent job..Job failing to run the script and I tried same with command prompt even though script filing to copy backup files form remote server Please some body help me by correcting the code.. net use X:/D /YES net use X:\\192.100.102.194\G$\BACKUP /persistent:NO DEL I:\Sync\INT-PROD.BAK /Q xcopy X:\Intranet\*.bak I:\Sync\INT-PROD.* /D /Z /Y net use X: /D Thanks in advance
May 30th, 2012 11:34am

If you try to run that script with your account does it run? Or how do you run the script? Maybe the net use command is failing due to not having /u:domain\user password set or I suggest to try to log the results for every command you run add something similar to >debuglog.txt 2>&1 at the end of each line net use X:/D /YES >>debuglog.txt 2>&1 net use X:\\192.100.102.194\G$\BACKUP /persistent:NO >>debuglog.txt 2>&1 DEL I:\Sync\INT-PROD.BAK /Q >>debuglog.txt 2>&1 xcopy X:\Intranet\*.bak I:\Sync\INT-PROD.* /D /Z /Y >>debuglog.txt 2>&1 net use X: /D >>debuglog.txt 2>&1
Free Windows Admin Tool Kit Click here and download it now
May 30th, 2012 5:38pm

If you try to run that script with your account does it run? Or how do you run the script? Maybe the net use command is failing due to not having /u:domain\user password set or I suggest to try to log the results for every command you run add something similar to >debuglog.txt 2>&1 at the end of each line net use X:/D /YES >>debuglog.txt 2>&1 net use X:\\192.100.102.194\G$\BACKUP /persistent:NO >>debuglog.txt 2>&1 DEL I:\Sync\INT-PROD.BAK /Q >>debuglog.txt 2>&1 xcopy X:\Intranet\*.bak I:\Sync\INT-PROD.* /D /Z /Y >>debuglog.txt 2>&1 net use X: /D >>debuglog.txt 2>&1
May 30th, 2012 5:49pm

Hey eduardite, Thanks for reply..yes I am not using username,password C:\WINDOWS\system32>net use X: /D /YES The network connection could not be found. More help is available by typing NET HELPMSG 2250. C:\WINDOWS\system32>net use X: \\192.100.102.194\G$\BACKUP /persistent:NO The password is invalid for \\192.100.102.194\G$. Enter the user name for '192.100.102.194': DEL I:\Sync\INT-PROD.BAK /Q -- is working fine
Free Windows Admin Tool Kit Click here and download it now
May 31st, 2012 5:06am

Thanks for reply..yes I am not using username,password That is your problem. You cannot map to an administrative share (G$) without a valid username/password combination. The command net use X:\\192.100.102.194\G$\BACKUP /persistent:NO is not valid w/out proper permissions granted by a username/password. You will need to just share the BACKUP folder from 192.100.102.194. If you want to hide the share, then append the $ at the end. You new UNC path would then look like net use X:\\192.100.102.194 BACKUP$ /persistent:NO You will still have to provide proper permissions to the share.
June 2nd, 2012 8:40pm

Thanks for reply..yes I am not using username,password That is your problem. You cannot map to an administrative share (G$) without a valid username/password combination. The command net use X:\\192.100.102.194\G$\BACKUP /persistent:NO is not valid w/out proper permissions granted by a username/password. You will need to just share the BACKUP folder from 192.100.102.194. If you want to hide the share, then append the $ at the end. You new UNC path would then look like net use X:\\192.100.102.194 BACKUP$ /persistent:NO You will still have to provide proper permissions to the share.
Free Windows Admin Tool Kit Click here and download it now
June 2nd, 2012 8:44pm

Any updates?Jeff Ren TechNet Community Support beneficial to other community members reading the thread.
June 4th, 2012 2:53am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics