#120454 - 2004-06-01 10:54 PM
How do I get reg SubKeyNames & values from SubKey?
|
chmod
Fresh Scripter
Registered: 2004-06-01
Posts: 24
Loc: Sacramento, CA
|
I can get key values but do not know how to get a list of SubKeyNames then take those SubKeyNames and pass that to get a key value from each SubKey. I have read most of the UDF's/Posts and can not find this info. How would I get SubKeyNames and values from those keys? Specifically from HKCU\Network - I want to list all the drives listed (i.e. SubKeys of \Network) and the UNC path, "RemotePath" value, listed in each SubKey. How can I do this? 
|
|
Top
|
|
|
|
#120456 - 2004-06-01 11:11 PM
Re: How do I get reg SubKeyNames & values from SubKey?
|
chmod
Fresh Scripter
Registered: 2004-06-01
Posts: 24
Loc: Sacramento, CA
|
I tried fEnumKey() and could not get it to work. It wont list the subkeys for HKCU\network, weird.
|
|
Top
|
|
|
|
#120458 - 2004-06-01 11:19 PM
Re: How do I get reg SubKeyNames & values from SubKey?
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
here is something for you to look at..
Code:
$index = 0
While @Error = 0
$key = EnumKey("HKCU\Network",$index)
If $key
$value = ReadValue ("HKCU\network\"+$key,"RemotePath")
? $key
? "Path : "+$value
?
Endif
$index = $index+1
Loop
get $
If you tell us what it is exactly that you're trying to accomplish we could probably help you more extensively.
Oh and Les...The HKCU\Network seems to just hold persistent drive mapping information (on XP Pro atleast).
|
|
Top
|
|
|
|
#120459 - 2004-06-01 11:19 PM
Re: How do I get reg SubKeyNames & values from SubKey?
|
chmod
Fresh Scripter
Registered: 2004-06-01
Posts: 24
Loc: Sacramento, CA
|
If you map a network share and make it persistant, a subkey will show up under \Network for that drive letter you just mapped. i.e. -Network F <-- Subkey (folders, with values in them) G H
|
|
Top
|
|
|
|
#120460 - 2004-06-01 11:25 PM
Re: How do I get reg SubKeyNames & values from SubKey?
|
chmod
Fresh Scripter
Registered: 2004-06-01
Posts: 24
Loc: Sacramento, CA
|
Quote:
here is something for you to look at..
Code:
$index = 0 While @Error = 0 $key = EnumKey("HKCU\Network",$index) If $key $value = ReadValue ("HKCU\network\"+$key,"RemotePath") ? $key ? "Path : "+$value ? Endif $index = $index+1 Loop
get $
Nice! That's exactly what I was trying to do CitrixMan! LOL That's awesome! Thank you guys, you are great!
|
|
Top
|
|
|
|
#120462 - 2004-06-02 01:00 AM
Re: How do I get reg SubKeyNames & values from SubKey?
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
Good point...I like the following one the best then...
Code:
$index = Execute("Exit 0") While @Error <> 259 $key = EnumKey("HKCU\Network",$index) If $key $value = ReadValue ("HKCU\network\"+$key,"RemotePath") ? $key ? "Path : "+$value ? Endif $index = $index+1 Loop
get $
|
|
Top
|
|
|
|
#120463 - 2004-06-02 02:05 AM
Re: How do I get reg SubKeyNames & values from SubKey?
|
chmod
Fresh Scripter
Registered: 2004-06-01
Posts: 24
Loc: Sacramento, CA
|
What does the Get $ on the last line do?
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Henriques)
and 2516 anonymous users online.
|
|
|