Jump to content

Recommended Posts

Posted (edited)

Good day,
I hope that the day finds you all very well!

I am currently working on a project that will permit me to perform what I refer to as "a portable application installation" of a number of audio-related applications.

Two of the applications involved the registry, for which I employed two scripts namely, 1) ExportRegKeys and 2) ImportRegKeys.

Though I "thought" that the scripts were performing the "job" for which such scripts were designed, I later discovered that though the ExportRegKeys script was performing correctly, that the ImportRegKeys script was not!

Following is what I was employing - which was|is not working:

$sKeyname = "D:\Install\App_Install\Digital_Audio\2_GR5\Data\RegKeys\hkcu.reg"
RunWait('REGEDIT /S ' & $sKeyname)

After much research, I did come across this little tid-bit: [Click_Me]

From that post, I ascertained the following sampling:

Run("REGEDIT /S " & "D:\Scripts Working\GlobalRemoveAll\RegKeys\AddMe.reg") ; DOES NOT work!
Run('REGEDIT /S "D:\Scripts Working\GlobalRemoveAll\RegKeys\AddMe.reg"') ; DOES work!

Question #1: "Am I better off 1) employing AutoIt to programmatically update the required Registry keys, or 1) am I better off employing .reg files?
• The latter option is certainly much easier to employ.

Question #2: If I DO employ the latter method, what is the best|preferred way of importing a .reg file with AutoIt - ensuring that the .reg data was indeed imported correctly?

As always...any assistance in this matter would be greatly appreciated!

Thank you for your time and attention to the above. Both are very much appreciated!

Edited by mr-es335
Posted

If something doesn't do what you want it to do, the first thing you have to do: Debugging.
In the simplest case, this means that you have passed values or variables output to find out their value at runtime to determine whether they have the expected value.

In your case here, simply outputting the call string you have put together is all you need to do:

ConsoleWrite("REGEDIT /S " & "D:\Scripts Working\GlobalRemoveAll\RegKeys\AddMe.reg" & @CRLF)
ConsoleWrite('REGEDIT /S "D:\Scripts Working\GlobalRemoveAll\RegKeys\AddMe.reg"' & @CRLF)

Then you will quickly see that the specific problem here is the spaces in the path.

Posted

Hello,

Though AspirinJunkie did assist me my previous two questions are still left unanswered...

Question #1: "Am I better off 1) employing AutoIt to programmatically update the required Registry keys, or 1) am I better off employing .reg files?
• The latter option is certainly much easier to employ.

Question #2: If I DO employ the latter method, what is the best|preferred way of importing a .reg file with AutoIt - ensuring that the .reg data was indeed imported correctly?

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
  • Recently Browsing   0 members

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