kneze Posted May 18, 2011 Share Posted May 18, 2011 Hi i have a registry key like HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content. This key has Subkeys. Each Subkeys has Values. I would like to create a table like; 1.line of table: Name of HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content\Subkey1 1.Column: 1.Value of HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content\Subkey1 2.Column: 2.Value of HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content\Subkey1 3.Column: 3.Value of HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content\Subkey1 4.Column: 4.Value of HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content\Subkey1 If subkey1 has no values go to HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content\Subkey2 2.line of table: Name of HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content\Subkey2 1.Column: 1.Value of HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content\Subkey2 2.Column: 2.Value of HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content\Subkey2 3.Column: 3.Value of HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content\Subkey2 4.Column: 4.Value of HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content\Subkey2 If subkey1 has no values go to HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content\Subkey3 etc. this Code works but the msgbox displays each Subkey in your own msgbox. FOR $i=1 to 5 $var=RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content",$i) If @error <> 0 then ExitLoop MsgBox(0, "Test", $var) Next tkanks for tipps. Link to comment Share on other sites More sharing options...
hannes08 Posted May 18, 2011 Share Posted May 18, 2011 (edited) Hi kneze, look at that code: Dim $var, $text, $i while 1 $i += 1 $var=RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Sample\content",$i) If @error <> 0 then ExitLoop $text = $text & @CRLF & $var Wend MsgBox(0,"Keys:", $text) You can add the values to an existing variable. This is a start. Have fun coding the rest. Edited May 18, 2011 by Hannes123 Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
kneze Posted May 19, 2011 Author Share Posted May 19, 2011 hi hannes your code works. i have your script expanded but var1 doesnt Work. when i try $var1=RegRead("HKEY_LOCAL_MACHINE\Sample\content", "Installation_status") it works but $var1=RegRead($var, "Installation_status") doesnt work. Dim $var, $var1, $text, $i while 1 $i += 1 $var=RegEnumKey("HKEY_LOCAL_MACHINE\Sample\content",$i) $var1=RegRead($var, "Installation_status") If @error <> 0 then ExitLoop $text = $text & @CRLF & $var & $var1 & @CRLF Wend MsgBox(0,"Keys:", $text) Link to comment Share on other sites More sharing options...
Arterie Posted May 19, 2011 Share Posted May 19, 2011 Shouldnt it be $var1=RegRead("HKEY_LOCAL_MACHINE\Sample\content",$var) ? Link to comment Share on other sites More sharing options...
kneze Posted May 19, 2011 Author Share Posted May 19, 2011 (edited) ok, i have now a script with all function and output that i need. i have an function in my script to check if remote computer is online. but the script don't exit if client isn't online. expandcollapse popup#include "array.au3" Case $Button_1 ;save Variable $Input as $PCNamen $CPname = GuiCtrlRead($Input) If $CPname = "" Then MsgBox(0, "Error", "Missing Computer Nr. ") Else MsgBox(0, "Info", "batch1 will be run.") $var = Ping($CPname,250) If @error = 0 Then Msgbox(0,"Status","Computer not online& $var) Else local $var, $var1,$var2, $text, $i, $j while 3 $j += 1 $var2=RegEnumKey("\\"&$cpname&"\HKEY_LOCAL_MACHINE\Sample\content",$j) If @error <> 0 then ExitLoop Wend Local $arr[$j][2] ; Populate array somehow $arr[0][0] = "key" $arr[0][1] = "status" while 4 $i += 1 $var=RegEnumKey("\\"&$cpname&"\HKEY_LOCAL_MACHINE\Sample\content",$i) If @error <> 0 then ExitLoop $var1 = RegRead("\\"&$cpname&"\HKEY_LOCAL_MACHINE\Sample\content\"& $var, "Installation_status" ) $arr[$i][0] = $var $arr[$i][1] = $var1 Wend EndIf EndIf _ArrayDisplay ($arr,"comment") Edited May 20, 2011 by kneze Link to comment Share on other sites More sharing options...
DXRW4E Posted September 16, 2012 Share Posted September 16, 2012 Ciao. Link to comment Share on other sites More sharing options...
BrewManNH Posted September 16, 2012 Share Posted September 16, 2012 Well, at least this time the thread is only 1 1/2 years old instead of 2 years. Necroposting is frowned upon, and so is self-promotion. JLogan3o13 1 If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
DXRW4E Posted September 17, 2012 Share Posted September 17, 2012 (edited) Well, at least this time the thread is only 1 1/2 years old instead of 2 yearsNot trying to be a smart OK hmmmmmm Not all users must necessarily do 4600 posts indicate ONLY the help of autoit , if I want to play you change irony pointing this and a few days ago OK, as already done just NOW OKKKNecroposting is frowned uponNot a Necroposting OKKK, I think I have already explained very well here I know you are now pretended not to understand ok I do not understand the reasons why you keep this discussion I believe and already clarified here OKor I have advice for you, best to try to spend time on other things instead of the ironic with users around in the forum OKand so is self-promotion.and forbidden to give a solution? (because you are not able to give a solution and prohibited to do it the other) but the real reason why put the link here was this, and you read that right tothe point is that I before making the RegEnumKeyEx, or read in forums and looking for RegEnumKey, have left 20-30 topics ect ect, after or fate to me that RegEnumKeyEx, after I had already in Firefox browser these posts and precisely or posted here and in another postalways with idea to be of help, because I'm confused actually looking RegEnumKey + array ect ect, there are many topics with all the hanging question and all without a real solutionwhy because you do not like it, or because you're jealous (you must offending other users?, how fucking dare you make judgments for another user without knowing it?) what the fuck do I know (Luckily you're not a moderator or admin here, if I delete the account immediately, no nerves to break with guys like you around), this says it all about the reason why ect ect ect (I owe you? also delete the )not nice to spend all the time with the purpose to break other OKKKK, not told that he must always speak when you do not do or say, still without speaking and better OKPS:I'm really really sorry (for real), wrong your nickname with that of guinness, guinness was not, but it was you you did servility with the story of , the post written here and for you OK (fuck I do not see where the crime here, and a crime to post a code fuck) Edited September 17, 2012 by DXRW4E Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 17, 2012 Moderators Share Posted September 17, 2012 (edited) I agree with BrewManNH on this, what benefit is there to resurrecting all of these old posts, just so you can promote something you wrote?"Profanity is the last refuge of the truly ignorant." - Anonymous Edited September 17, 2012 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
DXRW4E Posted September 17, 2012 Share Posted September 17, 2012 Yeah right, do Lobing Link to comment Share on other sites More sharing options...
Recommended Posts