makeinstall Posted March 11, 2009 Share Posted March 11, 2009 Hello all, This is the first time that I've used AutoIT and for what it can do, I dont know why I haven't come across it and started using it before now. It seems perfectly suited to building tools for tasks that I spend doing time over. To be able to cut down on having to reinvent the wheel, will increase productivity immensely. Anyway, enough gushing..... ;-) What Im trying to do is write a script that will RegDelete a whole set of keys relating to an application, that for some users hasnt installed properly but the script doesnt seem to be working and I'm up for advice about how to better approach things like this so as to instil better scripting practices so all advice is welcome. I have this script which has the regkeys to be removed: [saved as quickplace_regkeys.au3/.exe] ;# use $regvar to set the path of each key that needs to be deleted $regvar = "HKEY_CLASSES_ROOT\CLSID" RegDelete($regvar, "{05D96F71-87C6-11d3-9BE4-00902742D6E0}") $regvar = "HKEY_CLASSES_ROOT\Interface" RegDelete($regvar, "{05D96F70-87C6-11D3-9BE4-00902742D6E0}") RegDelete($regvar, "{EB189910-87C5-11D3-9BE4-00902742D6E0}") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID" RegDelete($regvar, "{05D96F71-87C6-11d3-9BE4-00902742D6E0}") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface" RegDelete($regvar, "{05D96F71-87C6-11d3-9BE4-00902742D6E0}") RegDelete($regvar, "{EB189910-87C5-11D3-9BE4-00902742D6E0}") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Classes" RegDelete($regvar, "QuickPlace.QuickPlace") RegDelete($regvar, "QuickPlace.QuickPlace.1") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Code Store Database\Distribution Units" RegDelete($regvar, "{05D96F71-87C6-11D3-9BE4-00902742D6E0}") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ModuleUsage" RegDelete($regvar, "C:/WINDOWS/Downloaded Program Files/qp2.dll") $regvar = "HKEY_CLASSES_ROOT\" RegDelete($regvar, "QuickPlace.QuickPlace") RegDelete($regvar, "QuickPlace.QuickPlace.1")oÝ÷ Ø Ý¶§"k¾)à¶jw¢jb)àÛazybH§Ú"¶Øk¢è!jz-êìr¸©¶Ú+ºv¬i٢ƯyÖ¬ªèZqä^Þ{ºÚ"µÍÈXÛHÙ[YKÜÝÛÜ[ÛÛ]ÛXZ[ØØ[ ÌÍÜÕÙ[YK ÌÍÜÔÜÝÛÜ ÌÍÜÐÛÛ]ÛXZ[ÈÙ]XXÈÚ][YÂÌÍÜÕÙ[YHH ÌÎNÖÚW]Ù[YVËÚWIÌÎNÂÌÍÜÔÜÝÛÜH ÌÎNÖÚWÜÝÛÜËÚWIÌÎNÂÌÍÜÐÛÛ]ÛXZ[H ÌÎNÖÚWYÛXZ[ËÚWIÌÎNÂÂÙ]H[ÈÛÛ[X[[Ê ÌÍÜÕÙ[YK ÌÍÜÐÛÛ]ÛXZ[ ÌÍÜÔÜÝÛÜ ][ÝÉÌLÉÌLÜ] ÌLÝÉÌLÜØÜ ÌLÛÛÌLÜÙÌLÜ]ZXÚÜXÙWÜYÚÙ^Ë^I][ÝÊ Any help would be greatly appreciated! ./chris Link to comment Share on other sites More sharing options...
erik7426 Posted March 11, 2009 Share Posted March 11, 2009 Hello all, This is the first time that I've used AutoIT and for what it can do, I dont know why I haven't come across it and started using it before now. It seems perfectly suited to building tools for tasks that I spend doing time over. To be able to cut down on having to reinvent the wheel, will increase productivity immensely. Anyway, enough gushing..... ;-) What Im trying to do is write a script that will RegDelete a whole set of keys relating to an application, that for some users hasnt installed properly but the script doesnt seem to be working and I'm up for advice about how to better approach things like this so as to instil better scripting practices so all advice is welcome. I have this script which has the regkeys to be removed: [saved as quickplace_regkeys.au3/.exe] ;# use $regvar to set the path of each key that needs to be deleted $regvar = "HKEY_CLASSES_ROOT\CLSID" RegDelete($regvar, "{05D96F71-87C6-11d3-9BE4-00902742D6E0}") $regvar = "HKEY_CLASSES_ROOT\Interface" RegDelete($regvar, "{05D96F70-87C6-11D3-9BE4-00902742D6E0}") RegDelete($regvar, "{EB189910-87C5-11D3-9BE4-00902742D6E0}") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID" RegDelete($regvar, "{05D96F71-87C6-11d3-9BE4-00902742D6E0}") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface" RegDelete($regvar, "{05D96F71-87C6-11d3-9BE4-00902742D6E0}") RegDelete($regvar, "{EB189910-87C5-11D3-9BE4-00902742D6E0}") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Classes" RegDelete($regvar, "QuickPlace.QuickPlace") RegDelete($regvar, "QuickPlace.QuickPlace.1") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Code Store Database\Distribution Units" RegDelete($regvar, "{05D96F71-87C6-11D3-9BE4-00902742D6E0}") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ModuleUsage" RegDelete($regvar, "C:/WINDOWS/Downloaded Program Files/qp2.dll") $regvar = "HKEY_CLASSES_ROOT\" RegDelete($regvar, "QuickPlace.QuickPlace") RegDelete($regvar, "QuickPlace.QuickPlace.1")oÝ÷ Ø Ý¶§"k¾)à¶jw¢jb)àÛazybH§Ú"¶Øk¢è!jz-êìr¸©¶Ú+ºv¬i٢ƯyÖ¬ªèZqä^Þ{ºÚ"µÍÈXÛHÙ[YKÜÝÛÜ[ÛÛ]ÛXZ[ØØ[ ÌÍÜÕÙ[YK ÌÍÜÔÜÝÛÜ ÌÍÜÐÛÛ]ÛXZ[ÈÙ]XXÈÚ][YÂÌÍÜÕÙ[YHH ÌÎNÖÚW]Ù[YVËÚWIÌÎNÂÌÍÜÔÜÝÛÜH ÌÎNÖÚWÜÝÛÜËÚWIÌÎNÂÌÍÜÐÛÛ]ÛXZ[H ÌÎNÖÚWYÛXZ[ËÚWIÌÎNÂÂÙ]H[ÈÛÛ[X[[Ê ÌÍÜÕÙ[YK ÌÍÜÐÛÛ]ÛXZ[ ÌÍÜÔÜÝÛÜ ][ÝÉÌLÉÌLÜ] ÌLÝÉÌLÜØÜ ÌLÛÛÌLÜÙÌLÜ]ZXÚÜXÙWÜYÚÙ^Ë^I][ÝÊ Any help would be greatly appreciated! ./chris On the RegDelete command you use the comma to define a specific value you want to delete from the specified key. In your script you have part of the key name in the value parameter. Your code should look like this... ;# use $regvar to set the path of each key that needs to be deleted $regvar = "HKEY_CLASSES_ROOT\CLSID" RegDelete($regvar & "\{05D96F71-87C6-11d3-9BE4-00902742D6E0}") $regvar = "HKEY_CLASSES_ROOT\Interface" RegDelete($regvar & "\{05D96F70-87C6-11D3-9BE4-00902742D6E0}") RegDelete($regvar & "\{EB189910-87C5-11D3-9BE4-00902742D6E0}") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID" RegDelete($regvar & "\{05D96F71-87C6-11d3-9BE4-00902742D6E0}") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface" RegDelete($regvar & "\{05D96F71-87C6-11d3-9BE4-00902742D6E0}") RegDelete($regvar & "\{EB189910-87C5-11D3-9BE4-00902742D6E0}") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Classes" RegDelete($regvar & "\QuickPlace.QuickPlace") RegDelete($regvar & "\QuickPlace.QuickPlace.1") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Code Store Database\Distribution Units" RegDelete($regvar & "\{05D96F71-87C6-11D3-9BE4-00902742D6E0}") $regvar = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ModuleUsage";I think this one may be right as-is RegDelete($regvar, "C:/WINDOWS/Downloaded Program Files/qp2.dll") $regvar = "HKEY_CLASSES_ROOT\" RegDelete($regvar & "\QuickPlace.QuickPlace") RegDelete($regvar & "\QuickPlace.QuickPlace.1") Link to comment Share on other sites More sharing options...
makeinstall Posted March 11, 2009 Author Share Posted March 11, 2009 (edited) On the RegDelete command you use the comma to define a specific value you want to delete from the specified key. In your script you have part of the key name in the value parameter. Your code should look like this... Excellent! Thank you Erik. I was following the function example on the site: but it appears that is incomplete/wrong. RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE", "TestKey") Edited March 11, 2009 by makeinstall 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