#119640 - 2004-05-15 03:55 AM
Reading REG_MULTI_SZ values in registry
|
japccna
Fresh Scripter
Registered: 2004-05-15
Posts: 5
|
I am trying to enumerate the shares on a users computer system when a user logs in. Here is the key I want to enumerate-$KEY = ENUMKEY("HKey_Local_Machine\System\CurrentControlSet\Services\lanmanserver\shares", $INDEX). All I get is Security, which is a subkey under Shares. I can see the shares in the registry but can't seem to extract the data....HELP
|
|
Top
|
|
|
|
#119642 - 2004-05-15 04:06 AM
Re: Reading REG_MULTI_SZ values in registry
|
japccna
Fresh Scripter
Registered: 2004-05-15
Posts: 5
|
I got disgusted and deleted most of it. Here it is.
? "Running Script #8 - Shares.kix" $INDEX = 0 :SWLOOP $KEY = ENUMKEY("HKey_Local_Machine\System\CurrentControlSet\Services\lanmanserver\shares", $INDEX) ? $KEY If @Error = 0 ; $shares = $key $INDEX = $INDEX + 1 GOTO SWLOOP
Here is what is returned to my text file> Running Script #8 - Shares.kix Security
|
|
Top
|
|
|
|
#119645 - 2004-05-15 04:25 AM
Re: Reading REG_MULTI_SZ values in registry
|
japccna
Fresh Scripter
Registered: 2004-05-15
Posts: 5
|
This code works fine. I am pulling data from "DisplayName and DisplayVersion"
$INDEX = 0 :SWLOOP $KEY = ENUMKEY("HKey_Local_Machine\Software\Microsoft\Windows\CurrentVersion\Uninstall", $INDEX) If @Error = 0 $PATH = "HKey_Local_Machine\Software\Microsoft\Windows\CurrentVersion\Uninstall\" + $KEY SELECT CASE EXISTKEY($PATH + "\DisplayName") $CACname = READVALUE($PATH,"DisplayName") $CACversion = READVALUE($PATH,"DisplayVersion") IF EXISTKEY($PATH + "\Uninstall String") AND $CACname = "ActivCard Gold" $CACReader = $CACname + " Version - " + $CACversion + @CRLF ENDIF EndSelect $INDEX = $INDEX + 1 GOTO SWLOOP ENDIF
|
|
Top
|
|
|
|
#119647 - 2004-05-15 04:29 AM
Re: Reading REG_MULTI_SZ values in registry
|
japccna
Fresh Scripter
Registered: 2004-05-15
Posts: 5
|
Dude, way to cool, that was all I needed to change. My text file now looks like this...
Running Script #8 - Shares.kix print$ MusicServer$ HPDJ845 NetAcademy$
Thanks a gazillion.
|
|
Top
|
|
|
|
#119649 - 2004-05-15 04:43 AM
Re: Reading REG_MULTI_SZ values in registry
|
japccna
Fresh Scripter
Registered: 2004-05-15
Posts: 5
|
Thanks again, here is the entire script.. it is called by another script that defines the logfile.
; Script # 8 (Shared Resources per machine) ? "Running Script #8 - Shares.kix" ;############################################################################################### ; TAKING INVENTORY OF Shared Resources ; ; 2004/05/14 -Written to display the systems shared resources - TSG Payne ; ;############################################################################################### ? "Shared resources for - @wksta" $INDEX = 0 :SWLOOP $shareskey = ENUMVALUE("HKey_Local_Machine\System\CurrentControlSet\Services\lanmanserver\shares", $INDEX) ? $shareskey If @Error = 0 $INDEX = $INDEX + 1 GOTO SWLOOP
Here's the output to the text file.
Running Script #8 - Shares.kix Shared resources for - 2252K80040031WB print$ MusicServer$ HPDJ845 NetAcademy$
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Henriques)
and 2516 anonymous users online.
|
|
|