iceberg Posted June 16, 2006 Posted June 16, 2006 Hi, Can someone kindly enlighten me as to why the error message doesn't appear if users don't have access rights to the registry? thanks. AutoItSetOption("TrayIconHide", 1) Opt("RunErrorsFatal", 1);1=fatal, 0=silent set @error RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoRun", "REG_DWORD", "1") If @error Then MsgBox(16, "Failure", "Error writing registry key or value. Please contact IT Dept for access rights.") Else MsgBox(0, "Success", "Please restart computer for changes to take effect.") EndIf Exit mouse not found....scroll any mouse to continue.
jpm Posted June 16, 2006 Posted June 16, 2006 Hi, Can someone kindly enlighten me as to why the error message doesn't appear if users don't have access rights to the registry? thanks. AutoItSetOption("TrayIconHide", 1) Opt("RunErrorsFatal", 1);1=fatal, 0=silent set @error RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoRun", "REG_DWORD", "1") If @error Then MsgBox(16, "Failure", "Error writing registry key or value. Please contact IT Dept for access rights.") Else MsgBox(0, "Success", "Please restart computer for changes to take effect.") EndIf ExitRunFataleror is for Run or runWait function execution, not for regwrite
Briegel Posted June 16, 2006 Posted June 16, 2006 Hi, Can someone kindly enlighten me as to why the error message doesn't appear if users don't have access rights to the registry? thanks. AutoItSetOption("TrayIconHide", 1) Opt("RunErrorsFatal", 1);1=fatal, 0=silent set @error RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoRun", "REG_DWORD", "1") If @error Then MsgBox(16, "Failure", "Error writing registry key or value. Please contact IT Dept for access rights.") Else MsgBox(0, "Success", "Please restart computer for changes to take effect.") EndIf Exit Why don't you work with "return value"?
iceberg Posted June 16, 2006 Author Posted June 16, 2006 jpm, thanks for pointing that out. Briegel, thanks for your hint...managed to get it! mouse not found....scroll any mouse to continue.
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