1

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?

user846290
  • 147
  • 1
  • 2
  • 10

1 Answers1

3

You should not use the -s switch.

From the docs:

-s Run remote process in the System account.

RB.
  • 36,301
  • 12
  • 91
  • 131
  • I have try to run it without the -s parameter, but if I do so, my application not even starts. – user846290 Nov 14 '12 at 10:27
  • My .log file looks like this, if I don't use the -s parameter > ERROR: Login failure: unknown user name or bad password. – user846290 Nov 14 '12 at 10:31
  • 2
    @user846290 That's a completely different issue to your question. I suggest you raise another question to get this answered. However, you should verify that the user-credentials you are passing to PSExec will allow you to login to that PC... – RB. Nov 14 '12 at 12:52