in reply to Creating a process as a normal user without password (Linux 'su' for Windows 7?)
Win32::FileOp::ShellExecute( runasuser => 'theProgram.exe' );
It will not let you specify the user to run the program under, it just displays a dialog box asking you to enter the credentials.
There is no way to pass the username&password to the ShellExecute API function. There is no way even with the ShellExecuteEx.
Seems you would need to call the CreateProcessAsUser function. It used to be available via Win32::AdminMisc, but you could call it yourself using Win32::API. Another option is to run the process through the "runas" utility. Run "runas /?" in the command prompt.
Jenda
Enoch was right!
Enjoy the last years of Rome.
|
|---|