mIRC Home    About    Download    Register    News    Help

Print Thread
Reading from the registry #209470 14/02/09 04:41 AM
Joined: Dec 2007
Posts: 24
T
Tzar469 Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2007
Posts: 24
Hi! I'm making a script that will launch an application. The trouble with this is that not everyone installed the application in the same place. However, the installer does write the install path to the registry: HKLM\Software\Westwood\ApocRise\InstallPath

Is there a way to read the information stored in this registry key?

Re: Reading from the registry [Re: Tzar469] #209471 14/02/09 04:43 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Quick little google search found this on mirc.org:
Code:
alias regread {
 if ($com(rr)) { !.comclose rr }
 !.comopen rr WScript.Shell
 var %a = $com(rr,RegRead,3,bstr,$1-)
 var %a = $com(rr).result
 !.comclose rr
 !return $iif(%a,%a,$null)
}


//echo -a $regread(HKLM\Software\Westwood\ApocRise\InstallPath)


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Reading from the registry [Re: argv0] #209482 15/02/09 07:10 AM
Joined: Dec 2007
Posts: 24
T
Tzar469 Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2007
Posts: 24
That works great! Thank you so much! laugh