in reply to Pass expected input to Windows program

Hi. If you do not need the output from your runas program, you could try opening an output filter to the command, then printing the password to it:

open(PROGRAM,"| runas /user:username command"); print PROGRAM "password\n";

Replies are listed 'Best First'.
Re: Re: Pass expected input to Windows program
by disciple (Pilgrim) on Apr 05, 2004 at 19:55 UTC
    It didn't work for me. I tried this:
    open(PROGRAM, '| runas /user:username "net localgroup administrators +%username%@%userdnsdomain% /ADD"'); print PROGRAM "password\n";
    This is the output:

    Enter password for username:RUNAS ERROR: Unable to accept input