mIRC Home    About    Download    Register    News    Help

Print Thread
read - parse regedit #251420 18/02/15 04:09 PM
Joined: Jun 2009
Posts: 91
V
vinifera Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 91
mind you... I havent touched mirc scripting in like ... 5 years :P
so don't shoot me down :P

can someone give me simple demonstration
how can mirc (6x version if possible) read certain
data from windows registry, and returned value echo in window

for example to read windows SKU, under
HKLM\SOFTWARE\Microsoft\Windows NT\Current Version: ProductName

Re: read - parse regedit [Re: vinifera] #251426 18/02/15 06:48 PM
Joined: Jul 2006
Posts: 3,559
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,559
I found this: http://forums.mirc.com/ubbthreads.php/ubb/showflat/Number/26829 which works, but I can't get it to return a value:

Code:
alias regread {
  var %a $ticks
  .comopen %a WScript.Shell
  if ($comerr) return ERROR
  var %c $com(%a,RegRead,3,bstr,$1)
  if (!%c) || ($comerr) {
    .comclose %a
    return ERROR
  }
  var %b = $com(%a).result
  .comclose %a
  return OK %b
}


Code:
//echo -a $regread(HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName)
Simply returns OK here, whereas I can see the correct value using the registry editor (/run regedit)


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: read - parse regedit [Re: Wims] #251444 18/02/15 10:21 PM
Joined: Jun 2009
Posts: 91
V
vinifera Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 91
yeah, i get "ok" too but no return value frown

BUT
i found one that works here:
http://www.mircscripts.org/forums.php?cid=3&id=142005

Last edited by vinifera; 18/02/15 10:40 PM. Reason: x
Re: read - parse regedit [Re: vinifera] #251449 18/02/15 11:24 PM
Joined: Jul 2006
Posts: 3,559
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,559
Right, the problem is that:
Originally Posted By: FiberOptics
The problem with WSH's regread method is that it returns the result from a REG_BINARY key in a VBarray rather than a string, so we can't access it in mIRC.
The trick is to use a COM object to execute some VB


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: read - parse regedit [Re: Wims] #251450 19/02/15 12:10 AM
Joined: Jun 2009
Posts: 91
V
vinifera Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 91
dunno what that means laugh
but it works .. so i'm happy laugh