Klez, most of the things you said is possible to do with mirc scripting.

To know if mIRC is running with admin privileges.

Code:
; $isadmin
; Returns $true or null

alias isadmin {
  if (!$isid) return
  set -l %a isadmin_ $+ $ticks $+ $rand(1111,9999))
  if ($com(locator_ $+ %a)) .comclose locator_ $+ %a
  .comopen locator_ $+ %a WbemScripting.SWbemLocator
  if ($comerr) return
  if ($com(services_ $+ %a)) .comclose services_ $+ %a
  if (!$com(locator_ $+ %a,ConnectServer,3,dispatch* services_ $+ %a)) || ($comerr) return
  .comclose locator_ $+ %a
  if ($com(os_ $+ %a)) .comclose os_ $+ services_ $+ %a
  if (!$com(services_ $+ %a,ExecQuery,3,bstr,Select * from Win32_OperatingSystem,dispatch* os_ $+ %a)) || ($comerr) return
  .comclose services_ $+ %a
  if ($com(os_ $+ %a,Count,3)) && ($comval(os_ $+ %a,1,SystemDirectory)) set -l %sysdir $v1 $+ \
  else return
  .comclose os_ $+ %a
  .fopen -o %a $qt(%sysdir $+ %a $+ .tmp)
  .fwrite %a $!true
  .fclose %a
  set -l %read $read(%sysdir $+ %a $+ .tmp)
  .remove $qt(%sysdir $+ %a $+ .tmp)
  return %read
}


Run with wait

Code:
; run2 -N <filename> [parameters]
; N = intWindowStyle in https://msdn.microsoft.com/en-us/library/d5fk67ky(v=vs.85).aspx
; //run2 cmd.exe | echo -s cmd.exe closed!

alias run2 {
  set -l %s 1
  if ($regex($1,/^-(\d+)$/)) {
    %s = $regml(1)
    tokenize 32 $2-
  }
  set -l %a run_ $+ $ticks $+ $rand(1111,9999))
  if ($com(%a)) .comclose %a
  .comopen %a WScript.Shell
  if ($comerr) return
  noop $com(%a,Run,1,bstr,$1-,int,%s,bool,true)
  .comclose %a
}


UAC
Code:
; $uac(File[,Arguments[,Directory[,Show]]])
; $uac(mirc.exe,$null,$nofile($mircexe))
; https://msdn.microsoft.com/pt-br/library/windows/desktop/gg537745(v=vs.85).aspx

alias uac {
  if (!$isid) || (!$1) || (($3) && (!$isdir($3))) || (($4) && (!$regex($4,/^\d+$/))) return
  set -l %s 1
  if ($regml(1)) %s = $v1
  set -l %arg $2
  set -l %dir $3
  set -l %a uac_ $+ $ticks $+ $rand(1111,9999))
  if ($com(%a)) .comclose %a
  .comopen %a Shell.Application
  if ($comerr) return
  if ($com(%a,ShellExecute,3,bstr,$1,bstr,%arg,bstr,%dir,bstr,runas,int,%s)) set -l %r 1
  .comclose %a
  return %r
}

Last edited by rockcavera; 17/02/17 01:41 PM.

rockcavera
#Scripts @ irc.VirtuaLife.com.br