Jump to content

problem launching Firefox with #RequireAdmin


Recommended Posts

I want to launch Firefox from a script, so I do:
 

#RequireAdmin

.....

Run( "C:\Program Files (x86)\Mozilla Firefox\firefox.exe", "C:\Program Files (x86)\Mozilla Firefox\", @SW_MAXIMIZE )

(I tried also ShellExecute)

It works well, but I found that if in explorer I doubleclick on some files  xxxx.htm they don't open in Firefox, nothing happens!

I discovered the problem is in the line #RequireAdmin: if I comment out it, FF works as expected.

So, how can I keep the script with admin privileges and also launch Firefox working as usual?
 

Link to comment
Share on other sites

So this is what I suspect the deal is; you're running FF with elevated privs, explorer does not run with elevated privs.  When you double-click a .htm the OS sees the FF process is open but the non-elevated process cannot interact with the elevated one.  There may be an event log entry showing a security failure which would indicate that it is trying but failing.

Make sense?

For my own curiosity; Why are you running FF with admin rights anyways?  It's never a good idea to browse the web with an elevated browser.

Link to comment
Share on other sites

  • Moderators

You cannot do "conditional" elevation in your script just using #RequireAdmin. If you have one part that needs elevation and one that doesn't, you'll need to run two scripts, or run just that application with RunAs, and specify credentials.

"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!

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...