frank10 Posted June 9, 2016 Share Posted June 9, 2016 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 More sharing options...
spudw2k Posted June 9, 2016 Share Posted June 9, 2016 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. AutoBert 1 Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
frank10 Posted June 9, 2016 Author Share Posted June 9, 2016 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? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 9, 2016 Moderators Share Posted June 9, 2016 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 More sharing options...
frank10 Posted June 9, 2016 Author Share Posted June 9, 2016 Ok, thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now