Link to home
Create AccountLog in
Avatar of roscoe513
roscoe513

asked on

runas not working

windows server 2003 x64
perl 5.8.8

I can't get my perl program to execute using runas. This is my first time using it. It pops up a cmd window for a second and that's it.  I then thought to run a simple windows .exe to test my runas command and that didn't work either.  See below.  I'm assuming that if I can get runas to launch a explorer window, I'll be able to also execute my perl script.

D:\jb>runas  /user:DOMAIN\USER "%systemroot%\explorer.exe"
Enter the password for DOMAIN\USER:
Attempting to start C:\WINDOWS\explorer.exe as user "DOMAIN\USER" ...
D:\jb>

Thanks for the help.
Steve
SOLUTION
Avatar of Hernan Ruggiano
Hernan Ruggiano
Flag of Australia image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of roscoe513
roscoe513

ASKER

As you can see, I tried launching an explorer window.  Also, the Windows service named "Secondary Logon" Is running.
SOLUTION
Avatar of Krzysztof Pytko
Krzysztof Pytko
Flag of Poland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
iSeik:

Running -> runas /user:username@domain_fqdn "explorer /separate"
did indeed bring up the explorer window, but didn't run my perl script.  

Running: runas /user:username@domain_fqdn "perl steve.pl  /separate"
brought up a cmd window for a split second and didn't exec the script.

steve.pl:
open (OUTPUT, ">tt.txt") or die $!;
print OUTPUT "test\n";

runing this (perl steve.pl) on the cmdline works as intended.

what is path to your perl compiler (or how it is called ;P )?

runas /user:username@domain_fqdn "path_to_perl_executebale_compiler steve.pl"

Should work

Krzysztof
I tried the absolute path to perl as suggested and also added the absolute path to steve.pl.  Both bring up a command window for a split second.  I get no error message from runas.

runas /user:DOMAIN\USERNAME "absolute path_to_perl_executebale_compiler steve.pl"

also tried:

runas /user:DOMAIN\USERNAME "absolute_path_to_perl_executebale_compiler absolute_path_to_steve.pl"
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
no objections
I found a partial solution on my own and greatly appreciate the help from the experts.