keilamym Posted February 27, 2013 Posted February 27, 2013 (edited) i just started writing this new code and as of now, its rather simple... i want autoit to look at the main "rebootrequired" key and based on its existance, i'll have it produce a popup or whatever...I created this simple code but the error code is ALWAYS the same (1) , regardless of if the rebootrequired key is there or not.RegRead ("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired","") MsgBox(4096,@error,@error)I figured the space between "Auto Update" was creating a problem but couldn't figure it out... ive writtien many scripts and have never had this problem.. any assistance would be appreciated. Edited February 27, 2013 by keilamym
Nessie Posted February 27, 2013 Posted February 27, 2013 (edited) Try this: $Check_Key = _Reg_KeyIsEmpty("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired") If $Check_Key = -1 Then MsgBox(16, "Error", "Key doesn't exist") Else If $Check_Key = 0 Then MsgBox(0, "Done", "The key exist and have values and keys.") ElseIf $Check_Key = 1 Then MsgBox(0, "Done", "The key exist and have only Keys.") ElseIf $Check_Key = 2 Then MsgBox(0, "Done", "The key exist and have only Values.") ElseIf $Check_Key = 3 Then MsgBox(0, "Done", "The key exist and have NOT values and Keys.") EndIf EndIf Func _Reg_KeyIsEmpty($eKey) ; -1: key doesn't exist ; 0: keys and values ; 1: only Keys ; 2: only Values ; 3: no Keys, no Values RegRead($eKey, '') If @error = 1 Then Return -1 Local $RegKeyIsEmptyCount = 0 RegEnumVal($eKey, 1) If @error = -1 Then $RegKeyIsEmptyCount += 1 RegEnumKey($eKey, 1) If @error = -1 Then $RegKeyIsEmptyCount += 2 Return $RegKeyIsEmptyCount EndFunc ;==>_Reg_KeyIsEmpty Edited February 27, 2013 by Nessie My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s). My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all! My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file
Akshay07 Posted March 12, 2013 Posted March 12, 2013 (edited) Hi Nessie (and all), I am also having problems when attempting to read this registry key: HKEY_LOCAL_MACHINESYSTEMControlSet001ControlClass{4D36E96D-E325-11CE-BFC1-08002BE10318}0000CodecInitDelay Nessie, I used your script and get the message "Key doesn't exist" but it does exist, I see its value with regedit. The path is correct, I used the "Copy Key Name" feature of the Windows Registry Editor. Key type is REG_SZ. Any hint would be welcomed ! Edit 1: I believe HKEY_LOCAL_MACHINESYSTEMControlSet001ControlClass{4D36E96D-E325-11CE-BFC1-08002BE10318}0000CodecInitDelay is available on most of the Windows PCs. Edit 2: If I use: HKEY_LOCAL_MACHINESYSTEMControlSet001ControlClass{4D36E96D-E325-11CE-BFC1-08002BE10318}0000 I get "The key exist and have values and keys." But i want the value of CodecInitDelay. Am I using the wrong instruction (RegRead) ? Edited March 12, 2013 by Akshay07
careca Posted March 12, 2013 Posted March 12, 2013 (edited) I have HKEY_LOCAL_MACHINESYSTEMControlSet001ControlClass{4D36E96D-E325-11CE-BFC1-08002BE10318}0000 But don't have that key 'CodecInitDelay'. win7 x64 pro Edited March 12, 2013 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Akshay07 Posted March 12, 2013 Posted March 12, 2013 Thanks Careca, My question is valid for any REG_SZ value that is under HKEY_LOCAL_MACHINESYSTEMControlSet001ControlClass{4D36E96D-E325-11CE-BFC1-08002BE10318}0000\
Nessie Posted March 12, 2013 Posted March 12, 2013 Hi Nessie (and all), I am also having problems when attempting to read this registry key: HKEY_LOCAL_MACHINESYSTEMControlSet001ControlClass{4D36E96D-E325-11CE-BFC1-08002BE10318}0000CodecInitDelay Nessie, I used your script and get the message "Key doesn't exist" but it does exist, I see its value with regedit. The path is correct, I used the "Copy Key Name" feature of the Windows Registry Editor. Key type is REG_SZ. Any hint would be welcomed ! Edit 1: I believe HKEY_LOCAL_MACHINESYSTEMControlSet001ControlClass{4D36E96D-E325-11CE-BFC1-08002BE10318}0000CodecInitDelay is available on most of the Windows PCs. Edit 2: If I use: HKEY_LOCAL_MACHINESYSTEMControlSet001ControlClass{4D36E96D-E325-11CE-BFC1-08002BE10318}0000 I get "The key exist and have values and keys." But i want the value of CodecInitDelay. Am I using the wrong instruction (RegRead) ? The HKEY_LOCAL_MACHINESYSTEMControlSet001ControlClass{4D36E96D-E325-11CE-BFC1-08002BE10318}0000CodecInitDelay doesn't exist on my Windows XP SP3 x86. Instead HKEY_LOCAL_MACHINESYSTEMControlSet001ControlClass{4D36E96D-E325-11CE-BFC1-08002BE10318}0000 exist and contains values and keys. Do you have an x64 system? BTW you have to use: RegRead("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E96D-E325-11CE-BFC1-08002BE10318}\0000\CodecInitDelay", "THE NAME OF THE VALUE THAT YOU WANT READ"). If you are using a 64 bit os you have to add a "64" after HKEY_LOCAL_MACHINE,so: RegRead("HKEY_LOCAL_MACHINE64\SYSTEM\ControlSet001\Control\Class\{4D36E96D-E325-11CE-BFC1-08002BE10318}\0000\CodecInitDelay", "THE NAME OF THE VALUE THAT YOU WANT READ") Hi! My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s). My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all! My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file
LarryDalooza Posted March 12, 2013 Posted March 12, 2013 (edited) ugh... RegRead("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E96D-E325-11CE-BFC1-08002BE10318}\0000","CodecInitDelay") Edited March 12, 2013 by LarryDalooza AutoIt has helped make me wealthy
careca Posted March 13, 2013 Posted March 13, 2013 LoL, yeah... Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Akshay07 Posted March 13, 2013 Posted March 13, 2013 ugh... RegRead("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E96D-E325-11CE-BFC1-08002BE10318}\0000","CodecInitDelay") Thank you !
Nessie Posted March 13, 2013 Posted March 13, 2013 Thank you !So your CodecInitDelay is a value and not a registry key as you have always said, that's why you had problem Hi! My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s). My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all! My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file
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