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.
the program must be the last argument try this :