Jump to content
frank10

problem launching Firefox with #RequireAdmin

Recommended Posts

frank10

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?
 

Share this post


Link to post
Share on other sites
spudw2k

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.

  • Like 1

Share this post


Link to post
Share on other sites
frank10

Yes, spudw2k, it makes sense.

Well, no, in fact I don't need admin privileges for Firefox, I want them for the rest of the script.

So, FF should be launched without admin privileges: how to?

Share this post


Link to post
Share on other sites
JLogan3o13

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
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

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.