in reply to Runas using open

runas.exe does not read passwords from stdin. It uses a call, CredUICmdLinePromptForCredentials() from a system dll that accesses the console directly. I assume that this is designed as a security measure.

You may be able to use Win32::Console to obtain a handle to the current console and the WriteInput() method to drive the program. This is an untested idea.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

Replies are listed 'Best First'.
Re^2: Runas using open
by slloyd (Hermit) on Jun 12, 2005 at 04:46 UTC
    Till now, I have never used Win32::Console. I tried a bunch of things but could not get anything to work...

    http://www.basgetti.com