Jump to content

Recommended Posts

Posted

I have a "main" program that at one point calls out a small EXE to run. The EXE is complied using the code below - all it performs are a couple reg delete's as well as applying an existing reg file silently, seems straightforward. However, the problem is that it will not run when compiled to EXE (error says "unable to open the script file"). It will run and work fine in just script form (au3) but not EXE. Also, the "main" program is a compiled EXE as well and contains a lot of reg delete etc..and works fine. I have tried compiling each of the lines below individually and it still won't run. Am I missing / overlooking something?

Thanks

RegDelete("HKEY_CURRENT_USER\Software\SolidWorks")
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\SRAC")
RegDelete("HKEY_CURRENT_USER\Software\SolidWorks BackOffice")
ShellExecuteWait( "regedit", "/s swSettings09.reg" , "C:\Progra~1\SolidWorks\DCC", "", @SW_HIDE )
Posted

I have a "main" program that at one point calls out a small EXE to run. The EXE is complied using the code below - all it performs are a couple reg delete's as well as applying an existing reg file silently, seems straightforward. However, the problem is that it will not run when compiled to EXE (error says "unable to open the script file"). It will run and work fine in just script form (au3) but not EXE. Also, the "main" program is a compiled EXE as well and contains a lot of reg delete etc..and works fine. I have tried compiling each of the lines below individually and it still won't run. Am I missing / overlooking something?

Thanks

RegDelete("HKEY_CURRENT_USER\Software\SolidWorks")
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\SRAC")
RegDelete("HKEY_CURRENT_USER\Software\SolidWorks BackOffice")
ShellExecuteWait( "regedit", "/s swSettings09.reg" , "C:\Progra~1\SolidWorks\DCC", "", @SW_HIDE )
Perhaps path out the .reg file:
ShellExecuteWait( 'regedit', '/s "' & @ScriptDir & '\swSettings09.reg"' , @ScriptDir, "", @SW_HIDE )

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted

Perhaps path out the .reg file:

ShellExecuteWait( 'regedit', '/s "' & @ScriptDir & '\swSettings09.reg"' , @ScriptDir, "", @SW_HIDE )

:)

Path it out for debugging purposes? How would the reg file be executed w/o a path?
Posted

Path it out for debugging purposes? How would the reg file be executed w/o a path?

Regedit.exe will be found by the %PATH%, so it doesn't need to be pathed out. However, your .reg file may need an explicit path to find it. That's what I was trying to show with my example.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted

Regedit.exe will be found by the %PATH%, so it doesn't need to be pathed out. However, your .reg file may need an explicit path to find it. That's what I was trying to show with my example.

:lmao:

Thanks for the help / suggestion. It is working now. Long day yesterday and I think I didn't have this "C:\Progra~1\SolidWorks\DCC" local path created and thus it was failing. :):think:

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
×
×
  • Create New...