Jenkins/Psexec – Error code 1 when I try to run a batch file on a virtual machine

batch-fileJenkinspsexec

"C:\Temp\PsTools\PsExec.exe" -accepteula -i \\ukvc-miu29-12 -u Domain\Username -p Password "C:\Testing1\testing.bat"

The above code is what is entered into Jenkins: Build -> Execute Windows batch command section.

`C:\Testing1\testing.bat exited on ukvc-miu29-12 with error code 1.

C:\Program Files (x86)\Jenkins\jobs\Run comparison script\workspace>exit 1
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE`

Basically trying to access the batch file on my virtual machine using Psexec tool and to run it there itself.

Any help is appreciated and will respond quickly to any suggestions, thanks!

Best Answer

I am not familiar with the -i argument there but I think you are missing the -W argument here-

Try this:

"C:\Temp\PsTools\PsExec -u USERNAME -p PASSWORD -w "C:\Testing1\testing.bat"

Also you might find this link useful : http://ss64.com/nt/psexec.html

Related Topic