mIRC Home    About    Download    Register    News    Help

Topic Options
#251420 - 18/02/15 04:09 PM read - parse regedit
vinifera Offline
Babel fish

Registered: 21/06/09
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

Top
#251426 - 18/02/15 06:48 PM Re: read - parse regedit [Re: vinifera]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3496
Loc: France
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

Top
#251444 - 18/02/15 10:21 PM Re: read - parse regedit [Re: Wims]
vinifera Offline
Babel fish

Registered: 21/06/09
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


Edited by vinifera (18/02/15 10:40 PM)
Edit Reason: x

Top
#251449 - 18/02/15 11:24 PM Re: read - parse regedit [Re: vinifera]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3496
Loc: France
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

Top
#251450 - 19/02/15 12:10 AM Re: read - parse regedit [Re: Wims]
vinifera Offline
Babel fish

Registered: 21/06/09
Posts: 91
dunno what that means laugh
but it works .. so i'm happy laugh

Top