cpremo Posted May 20, 2008 Posted May 20, 2008 I'm trying to read a registry value and make a dicision based on that. However, I can't seem to get it to work if the registry entry is not there. This is what I have: ************************************ If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Login","Workstation Only") = 0 Then ElseIf RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Login","Workstation Only") <> 0 or RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Login","Workstation Only") =1 Then RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Login","Workstation Only","Reg_DWORD","0") EndIf ********************************** I've also tried this: ********************************** If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Login","Workstation Only") = 0 Then ElseIf RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Login","Workstation Only") <> 0 then RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Login","Workstation Only","Reg_DWORD","0") ElseIf RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Login","Workstation Only") =1 Then RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Login","Workstation Only","Reg_DWORD","0") EndIf *********************************
weaponx Posted May 20, 2008 Posted May 20, 2008 $result = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Login","Workstation Only") If @ERROR Then ...;FAIL Else ...;OK EndIf
zorphnog Posted May 20, 2008 Posted May 20, 2008 Try this: Local $iValue $iValue = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Login","Workstation Only") If $iValue = "" Or $iValue <> 0 Then RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Login","Workstation Only","Reg_DWORD","0")
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