PSExec run remote batch file

batch-filepsexecremote desktop

I wanna run remote a batch file with PSExec, so my code looks like this:

cd C:\PsTools
PsExec.exe \\<computer> -u <user> -p <password> -s -i <"pathToBatchFile\batch.bat">  
exit

After I call the batch file on the remote computer, the application on the remote computer is starting under the SYSTEM account. I wanna start it under another account.

How can I do this?

Best Answer

You should not use the -s switch.

From the docs:

-s Run remote process in the System account.