mIRC Home    About    Download    Register    News    Help

Print Thread
#266146 10/10/19 04:57 AM
Joined: Jan 2004
Posts: 2,127
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
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.

maroon #266150 10/10/19 08:00 PM
Joined: Oct 2017
Posts: 47
D
Ameglian cow
Offline
Ameglian cow
D
Joined: Oct 2017
Posts: 47
That sounds very useful , nice idea!

maroon #266151 11/10/19 04:00 AM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
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


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard