Mecano Posted December 10, 2007 Posted December 10, 2007 Hallo forum members, I try to find out how to find a exact key from the register RegEnumKey shows the key is there in de Message box So when $var contains Photoshop then the message must be MsgBox(48,"Found","Found Photoshop",2) But it shows No Photoshop","No Photoshop found What Im doing wrong? ;Test if to find out if Photoshop was on this computer #NoTrayIcon For $i= 1 to 10 $var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe", $i) If @error <> 0 then ExitLoop MsgBox(4096, "SubKey #" & $i & " under HKLM\Software: ", $var);Msg box is just an test to see Photoshop is there Next $ff = ($var & "\Photoshop") If $ff = 1 Then MsgBox(48,"Found","Found Photoshop",2) Else MsgBox(64,"No Photoshop","No Photoshop found",2) EndIf
mikiutama Posted December 10, 2007 Posted December 10, 2007 $ff = ($var & "\Photoshop") If $ff = 1 Then MsgBox(48,"Found","Found Photoshop",2) Else MsgBox(64,"No Photoshop","No Photoshop found",2)EndIffor you info... $ff value is "HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Photoshop" and not 1 !!that's why you get "No Photoshop found"
weaponx Posted December 10, 2007 Posted December 10, 2007 I was going to say just do this but if the default value is blank it sets @ERROR (Bug?) : $result = RegRead("HKLM\Software\Adobe\Photoshop", "") If @ERROR Then MsgBox(0,"","Photoshop not found") Else MsgBox(0,"","Photoshop found") EndIf
mikiutama Posted December 10, 2007 Posted December 10, 2007 or you can do this... ;Test if to find out if Photoshop was on this computer #NoTrayIcon For $i= 1 to 10 $var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe", $i) If @error <> 0 then ExitLoop If $var = "Photoshop" Then MsgBox(48,"Found","Found Photoshop",2) Else MsgBox(64,"No Photoshop","No Photoshop found",2) EndIf ;MsgBox(4096, "SubKey #" & $i & " under HKLM\Software: ", $var);Msg box is just an test to see Photoshop is there Next
Mecano Posted December 10, 2007 Author Posted December 10, 2007 Thanxs to all for repley I started with this RegRead and didnt work that's why I tried it with RegEnumKey $result = RegRead("HKLM\Software\Adobe\Photoshop", "") If @ERROR Then MsgBox(0,"","Photoshop not found"): Nope Else MsgBox(0,"","Photoshop found") EndIf Doesn't work you have to put the full string in the script ,dont want to use this cause could be as well an other version ----------------------------------------------------------------------------------------------------------------------------------- result = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Photoshop\9.0", "PluginPath") If @ERROR Then MsgBox(0,"","Photoshop not found") Else MsgBox(0,"","Photoshop found"): Yep EndIf ========================================================================== This script give a loop 4 times an message box the third says found photoshop #NoTrayIcon For $i= 1 to 10 $var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe", $i) If @error <> 0 then ExitLoop If $var = "Photoshop" Then MsgBox(48,"Found","Found Photoshop",2) Else MsgBox(64,"No Photoshop","No Photoshop found",2) EndIf ;MsgBox(4096, "SubKey #" & $i & " under HKLM\Software: ", $var);Msg box is just an test to see Photoshop is there Next ----------------------------------------------------------------------------------------------------------------------------------- the reg code: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Photoshop\9.0] "FreeBeforeSlopAdjust"=dword:0013ddf0 "FreeSpace"=dword:0009c228 "ApplicationPath"="E:\\Program Files\\Adobe\\Adobe Photoshop CS2\\" "PluginPath"="" Want to make tis one to detect more versions then Photoshop 9 Maybe StringSplit an option? but I'm an newbie with this a little kick in the right direction
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