I haven't used it personally, but Win32::CtrlGUI may very well help you out -- use system to kick off Runas (or whatever commandline program), and use Win32::CtrlGUI to find the resulting dos window by name, and send it the password (possibly after a sleep).