Ordinarily thats (backticks) exactly what I'd do, but you cant use runas (AFAIK) with backticks without the program prompting the user for the password. I want the password to be automatically supplied when requested by runas - hence the need for win32::ole.
Unless you know another way?
| [reply] |
Short googling for runas without password suggests psexec via ExpertSexChange, to which you can supply the username and password directly. Likely you can achieve the same using a Perl module, but I haven't had the need yet.
| [reply] |
I did use google (extensively) and this site before posting. Give me some credit! :-)
Despite a few weeks work of searching I haven't found a way do do via any other Perl module than Expect - which doesn't work on a Windows system due to IT::Tty being unavailable.
In terms of psexec, it'll do exactly the same as my script, except mine doesn't need another exe bundled with it. The problem remains though: all I'll get back from it is that psexec completed with error code 0. I wont actually get the return code back from net send, which is my problem, not making the script run as someone else, that part works fine.
| [reply] |