Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hey there, I would like to start an executable (test.exe) that has been set to start with administrator privileges. This means I set it up manually by right clicking on it (Properties), going to Compatibility tab, and checking the bottom checkbox (run as administrator).
use Win32::Process; Win32::Process::Create($proc, 'C:\test.exe', 'test.exe', 0, NORMAL_PRI +ORITY_CLASS, '.')
I'm running my perl script as a normal user, and it can't start this executable mentioned above, because it can't get admin rights. This makes sense, but when I start test.exe manually (from Total Commander or Windows Explorer) it blanks out the screen and asks for approval of giving it elevated privileges. I want Win32::Process::Create do the same, because now it doesn't ask anything, it just fails to start the application.

Is there a workaround using Win32::Process?
Alternatively, is there a way or a special parameter that would ask for administrator privileges before trying to create a process out of this application?

My Win32::Process version is 0.14 and I'm running Windows 7 with UAC enabled.

Thanks in advance,
stringZ

In reply to Win32::Process::Create with elevated privileges on Windows 7 by stringZ

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-24 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found