Jump to content

Recommended Posts

Posted

How do i run an exe file from a shared location (no password required) with administrator rights

Location :  <ip>softwaressetup.exe

I want to execute it as "Run as administrator"

Any suggestions?

Posted

I have tried the RunAs() function. But  in my case i don't need the username and password.

Just access the shared location and run the file as administrator

  • Moderators
Posted

If you just want to run it with admin rights, and you're not having to provide the credentials of a different user, try adding #RequireAdmin at the top of your script.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

Thanks JLogan3o13 for the suggestion,

I had already tried that in my script but no effect and I still have to manually do a "Run as Administrator"

Any other suggestions?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...