mIRC Homepage

$isadmin

Posted By: maroon

$isadmin - 10/10/19 04:57 AM

In coordination with /run -a, it might be useful to have an identifier to indicate whether mIRC itself is running with elevated privileges. Perhaps $isadmin or $iselevated.

The status of mIRC itself has an effect on the /run -a command. If mIRC itself is running as admin already, /run's -a switch doesn't trigger the UAC prompt.

Also, if mIRC itself is running as administrator, then programs launched with the /run command seem to be given admin privileges automagically, regardless whether using the -a switch. I hadn't realized launched programs were also inheriting admin mode since the UAC prompt didn't pop up. I assume that's the default and it's not feasible to have a switch to not let the target program inherit the admin privileges possessed by mIRC itself running in admin mode.
Posted By: DooMaster

Re: $isadmin - 10/10/19 08:00 PM

That sounds very useful , nice idea!
Posted By: Raccoon

Re: $isadmin - 11/10/19 04:00 AM

Wha'... you don't like my $isadmin alias? I'm sure I shared it. :P

Code
; Usage:  if ($isadmin) { blah }
IsAdmin { var %file = $+($regsubex($envvar(SystemDrive),/\\?$/,\),TestIsAdmin_,$ticks,$r(1,99999999999999),.$$$) | .fopen -no admintest $qt(%file) | .fclose admintest | var %rslt = $exists(%file) | if (%rslt) .remove $qt(%file) | if (!$isid) echo -a * IsAdmin: %rslt | return %rslt } ; by Raccoon 2017-Feb
© 2019 mIRC Discussion Forums