Jump to content

RegRead works as a .au3 script, but not as a compiled .exe


Recommended Posts

Was there a known issue with RegRead of v3.2.10.0?

It works fine as a script, but does not return anything after it is compiled.

I am using RegRead to pull data from remote servers.

I have put off upgrading to the latest version until December when I will have more time to convert my scripts.

But I will install the latest versions on one machine just to see if this will work correctly.

Thank you for any input.

taurus905

"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Link to comment
Share on other sites

Short script that reproduces your problem?

Hello LarryDalooza,

I am sorry for not providing the following script earlier.

$s_Server = "RemoteServerName"
$s_Registry_Section = "HKLM"
$s_Registry_KeyPath = "SOFTWARE\Microsoft\Microsoft SQL Server"
$s_Registry_ValueName = "InstalledInstances"
$s_Registry_Data = RegRead("\\" & $s_Server & "\" & $s_Registry_Section & "\" & $s_Registry_KeyPath, $s_Registry_ValueName)
MsgBox(0, "$s_Registry_Data", $s_Registry_Data)
This works fine until it is compiled.

Thank you for your help.

taurus905

"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Link to comment
Share on other sites

Do you run your AU3/EXE from the same computer?

Also try to add some error checking/logging to your script.

RegRead - on failure:

Returns "" and sets the @error flag:

1 if unable to open requested key

2 if unable to open requested main key

3 if unable to remote connect to the registry

-1 if unable to open requested value

-2 if value type not supported

Link to comment
Share on other sites

Do you run your AU3/EXE from the same computer?

Also try to add some error checking/logging to your script.

RegRead - on failure:

Hello Zedna,

Thank you for your suggestion to add some error checking.

I have AutoIt installed on a machine running Server 2003 64-bit. When I run the script, it works fine. And when I compile the script and run the .exe, it only works from that server. I cannot run it from another server without getting the following message:

---------------------------

The image file E:\Documents and Settings\a-tehar\Desktop\RegRead Test-c.exe is valid, but is for a machine type other than the current machine.

---------------------------

But if I compile the script with options, I get the -1 error message (unable to open requested value) on the server it was compiled on and another server I transferred it to.

I just wonder why a script can open the requested value but a .exe cannot. I don't recall having this issue last week. Maybe some permissions were changed.

Many thanks to you and LarryDalooza for your help.

taurus905

$s_Server = "RemoteServerName"
$s_Registry_Section = "HKLM"
$s_Registry_KeyPath = "SOFTWARE\Microsoft\Microsoft SQL Server"
$s_Registry_ValueName = "InstalledInstances"
$s_Registry_Data = RegRead("\\" & $s_Server & "\" & $s_Registry_Section & "\" & $s_Registry_KeyPath, $s_Registry_ValueName)
If @error Then
    MsgBox(0, "@error", @error)
Else
    MsgBox(0, "$s_Registry_Data", $s_Registry_Data)
EndIf

"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

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...