Sign in to follow this  
Followers 0
iceberg

RegWrite @ error

4 posts in this topic

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.

Share this post


Link to post
Share on other sites



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
RunFataleror is for Run or runWait function execution, not for regwrite :D

Share this post


Link to post
Share on other sites

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"?

Share this post


Link to post
Share on other sites

jpm, thanks for pointing that out.

Briegel, thanks for your hint...managed to get it!


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0