mIRC Home    About    Download    Register    News    Help

Print Thread
#176221 06/05/07 11:20 AM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
alias reg return $dll(registry.dll, GetKeyValue, $1)

is there any other way to do it, i don't really want to use any dlls in my script. at the moment all i use it for is

$reg(HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\\Fonts)

Last edited by pouncer; 06/05/07 11:21 AM.
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Code:
alias registry.read {
  var %key = HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\\Fonts
  echo -a $regread(%key)
}

alias -l regread {
  var %a = regread $+ $ticks, %c
  .comopen %a WScript.Shell
  if (!$comerr) {
    var %b = $com(%a,RegRead,3,bstr,$1-), %c = $com(%a).result
    .comclose %a
  }
  return $iif((%c),$ifmatch,Error)
}


Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
Thanks. But i got to ask if it that will work on all os platforms?

win 98, win 2000, xp, vista, etc etc?

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Many com objects are using WMI (Windows Management Instrumentation) - They will not work on Windows older than NT 5 (that is: older than Windows 2k).

Means, coms using WMI:
- will not work innately at 95, 98, 98SE, NT4 (but, it's possible to download WMI for these at microsoft.com)
- will work innately at ME, 2k, XP, 2003, Vista... (as WMI is embedded there)

The com given here does not use WMI, it will work on any Windows.

EDIT: P.S. Note that above-mentioned WMI compatibility issues apply for prevalent dlls (like moo.dll / darkengine*.dll): the only difference is that they provide compiled code.


Link Copied to Clipboard