Why can I use the cmd.exe on a vbs file but not a bat file?
I am using SQL 2008 R2 on Server A. In a SQL job, I set the following command to execute on a different server. **cmd.exe /c "\\\\mchsbiess01p\\Scripts\\Test\\TestEmailUtility.vbs"** with success. when I use **cmd.exe /c "\\\\mchsbiess01p\\Scripts\\Bat\\Planning\\RunPullLawsonLoad.bat"** I get the error "Executed as user: MCHSNT\\SPSQLS1. C:\\Windows\\system32>D: D:\\>D:\\Oracle\\Middleware\\user_projects\\epmsystemEss01P\\EssbaseServer\\essbaseserver1\\bin\\startMaxL.bat -D D:\\Scripts\\Maxl\\Planning\\PullLawsonLoad.mxls 581060833,1161870527 The system cannot find the path specified. Process Exit Code 1. The step failed." I have verified the path on server mchsbiess01p, but it seems the command is executing on the sql server A, not the specified server mchsbiess01p. Can someone help? thanks, Maggie
Whenever you run a batch file it will always execute locally. If you need it to utilize the remote path then you will need to fully qualify the path to the remote server. \\\\mchsbiess01p\\D$\\Oracle\\Middleware\\user_projects\\epmsystemEss01P\\EssbaseServer\\essbaseserver1\\bin\\startMaxL.bat -D \\\\mchsbiess01p\\D$\\Scripts\\Maxl\\Planning\\PullLawsonLoad.mxls 581060833,1161870527 Depending on what the batch file does you may also run into the issue whereby it is looking for software on your local machine. That would require an install. A possible workaround for this would be to use [PowerShell remoting] or to call [PSExec] on the remote server to launch the batch file there. :