I am trying to pass in the password to the runas program. Shouldn't this work?
my $cmd=qq|runas /profile /user:$user "$exe"|;
open(FH,"| $cmd") || die $^E;
print FH $pass;
It does not seem to be sending the password.
I get the following output:
Enter the password for tester:
Attempting to start myprogram.exe as user "GUYBOX\tester" ...
RUNAS ERROR: Unable to run - myprogram.exe
1326: Logon failure: unknown user name or bad password.
What am I doing wrong?