Reputation: 1434
I used to use runas
for running my app under another user account. Now I need to pass the password through as well. I found that psexec
is an easy way to do it.
So the batch file contains:
@echo off
psexec my.exe -u hostname\user -p password
The problem is my.exe
is still being initiated under the user I'm currently logged onto the system with and not under the one declared in the cmd above.
Upvotes: 0
Views: 438
Reputation: 26170
the program must be the last argument try this :
psexec -u hostname\user -p password my.exe
Upvotes: 1