Jump to content

RegWrite @ error


Recommended Posts

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.

Link to comment
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
Link to comment
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"?
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...