edy Posted August 27, 2004 Share Posted August 27, 2004 With RegEnumVal how can i obtain all the istance of a keyname? Thanks Link to comment Share on other sites More sharing options...
this-is-me Posted August 27, 2004 Share Posted August 27, 2004 You don't use regenumval. You use regenumkey. Who else would I be? Link to comment Share on other sites More sharing options...
edy Posted August 27, 2004 Author Share Posted August 27, 2004 with RegEnumKey i obtain a subkey, if i want to obtain for example all values under the key: HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities how can get it? regards Link to comment Share on other sites More sharing options...
this-is-me Posted August 27, 2004 Share Posted August 27, 2004 (edited) $start = 1 while 1 $enum = regenumkey("HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities", $start) if @error then exitloop $start = $start + 1 msgbox(0,"",$enum) wend Edited August 27, 2004 by this-is-me Who else would I be? Link to comment Share on other sites More sharing options...
edy Posted August 27, 2004 Author Share Posted August 27, 2004 (edited) $start = 1 while 1 $enum = regenumkey("HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities", $start) if @error then exitloop $start = $start + 1 msgbox(0,"",$enum) wend <{POST_SNAPBACK}>It work with regenumval: while 1 $enum = regenumval("HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities", $start) if @error then exitloop $start = $start + 1 msgbox(0,"",$enum) wend With Windows NT 4 don't work , even if the key exists does not find it , using the utility reg.exe find it. With windows 2000 and windows 2003 it's OK. Thanks Edited August 27, 2004 by Larry Link to comment Share on other sites More sharing options...
edy Posted August 28, 2004 Author Share Posted August 28, 2004 It work with regenumval: while 1 $enum = regenumval("HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities", $start) if @error then exitloop $start = $start + 1 msgbox(0,"",$enum) wend With Windows NT 4 don't work , even if the key exists does not find it , using the utility reg.exe find it. With windows 2000 and windows 2003 it's OK. Thanks <{POST_SNAPBACK}>@Jon Is it a bug of regenumval if in Windows Nt don' t work ? Link to comment Share on other sites More sharing options...
Administrators Jon Posted August 28, 2004 Administrators Share Posted August 28, 2004 I'l have to check, should work fine though. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
edy Posted August 29, 2004 Author Share Posted August 29, 2004 I'l have to check, should work fine though. <{POST_SNAPBACK}>In this exsample with windows nt 4 work fine : Computer "pluto" and "paperino" same domain NT From PC Pluto or viceversa $var1=RegEnumVal("\\paperino\HKL_M\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities",2) return valid istance. In this example with windows nt 4 don't work : Computer "pluto" and "paperino" different domain NT but with trust (user with valid permission) $var1 = RegEnumVal("\\paperino\HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities",2) value returned : $var1 = "" N.B. if i use Regread i can read di value under "ValidCommunities" with the same username . This same situation with windows 2000, 2003 or XP work fine. Regards Link to comment Share on other sites More sharing options...
edy Posted August 31, 2004 Author Share Posted August 31, 2004 No answer ? Link to comment Share on other sites More sharing options...
this-is-me Posted August 31, 2004 Share Posted August 31, 2004 Looks like a problem with accessing the remote registry all together. Have you tried to simply read a value without enum? Who else would I be? Link to comment Share on other sites More sharing options...
SlimShady Posted August 31, 2004 Share Posted August 31, 2004 (edited) I didn't know you could read/write from/to remote registries with AutoIt.Edit:A registry key must start with "HKEY_LOCAL_MACHINE" ("HKLM") or "HKEY_USERS" ("HKU") or "HKEY_CURRENT_USER" ("HKCU") or "HKEY_CLASSES_ROOT" ("HKCR") or "HKEY_CURRENT_CONFIG" ("HKCC"). Edited August 31, 2004 by SlimShady Link to comment Share on other sites More sharing options...
Developers Jos Posted August 31, 2004 Developers Share Posted August 31, 2004 (edited) I didn't know you could read/write from/to remote registries with AutoIt. Edit: <{POST_SNAPBACK}>Here is the total remarks section from the helpfile... look at the bottom of it...: Remarks A registry key must start with "HKEY_LOCAL_MACHINE" ("HKLM") or "HKEY_USERS" ("HKU") or "HKEY_CURRENT_USER" ("HKCU") or "HKEY_CLASSES_ROOT" ("HKCR") or "HKEY_CURRENT_CONFIG" ("HKCC"). AutoIt supports registry keys of type REG_BINARY, REG_SZ, REG_MULTI_SZ, REG_EXPAND_SZ, and REG_DWORD. To access the (Default) value use "" (a blank string) for the valuename. When reading a REG_BINARY key the result is a string of hex characters, e.g. the REG_BINARY value of 01,a9,ff,77 will be read as the string "01A9FF77". When reading a REG_MULTI_SZ key the multiple entries are seperated by @LF - use with StringSplit(..., @LF) to get each entry. It is possible to access remote registries by using a keyname in the form "\\computername\keyname". To use this feature you must have the correct access rights on NT/2000/XP/2003, or if you are using a 9x based OS the remote PC must have the remote regsitry service installed first (See Microsoft Knowledge Base Article - 141460). Edited August 31, 2004 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
edy Posted August 31, 2004 Author Share Posted August 31, 2004 I didn't know you could read/write from/to remote registries with AutoIt. Edit: <{POST_SNAPBACK}>When i Read the remote registry of a Computer with windows NT 4 with RegEnumVal from a computer with Windows Nt/Win2k/xp/w2k3 in different domain with trust, don't read the correct istance (null string). If ,same condition, the remote computer has W2k/xp/w2k3 it work fine (read the correct istance). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now