views:

15

answers:

2

How to Detect IE7/IE8 "run as administrator" mode with Javascript? I have a html page that needs to be run in administrator mode.

I can detect if it is ie8/7 and when that occurs I pop-up an alert saying the user must be in administrator mode for the page to work (because it runs an active-x that doesn't work other wise). That, however, cause confusion when the user comes back to the page in admin mode and they get the same alert message.

+2  A: 

As per @Darth, this should be in SO, but I'm going to guess you won't be able to detect if a user is in administrator mode. Having the browser announce such information is just asking for so much trouble you'll want to rip your hair out.

Example, bad site asks users to run in admin mode, users are stupid and do it, user gets viruses/spam/crap/hacks/etc.

Alex
+2  A: 

Just an idea: use try and catch

try{
    var x = new ActiveXObject("SomethingSomething.DarkSide");
}
catch(e){
    alert("ActiveX failed, blah blah, additional info:\n" + e.description);
}
dev-null-dweller