Trying to run a command with a user that is not logged in

View: New views
2 Messages — Rating Filter:   Alert me  

Trying to run a command with a user that is not logged in

by Gary Kuznitz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am trying a different angle on running a command with a user that is not
logged on.  The command I am trying is:
call runas /user:ATUUSER4\scans "ScanFiles.exe"
 IF %ERRORLEVEL%==0 Echo command succeeded
Pause

All the commands I need are compiled in an AutoIt script called ScanFiles.exe.
When It runs I get a command window asking me for the password.  As soon as I
put the password in the window closes.

How can I keep the window open so I can see if the command succeeded?

Thank you,

Gary Kuznitz

Re: Trying to run a command with a user that is not logged in

by foxidrive-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 07 May 2008 22:27:20 -0700, "Gary Kuznitz" <docfxit@...>
wrote:

>I am trying a different angle on running a command with a user that is not
>logged on.  The command I am trying is:
>call runas /user:ATUUSER4\scans "ScanFiles.exe"
> IF %ERRORLEVEL%==0 Echo command succeeded
>Pause
>
>All the commands I need are compiled in an AutoIt script called ScanFiles.exe.
>When It runs I get a command window asking me for the password.  As soon as I
>put the password in the window closes.
>
>How can I keep the window open so I can see if the command succeeded?

Try opening a cmd window and launching the command manually.

If the autoit script is creating the window then running the command in
autoit with:

%comspec% /K command_here

might leave the window open.

LightInTheBox - Buy quality products at wholesale price