Jump to content

Recommended Posts

Posted

Good day,

Due to the most excellent assistance of ioa747, I am able to create "shell" scripts that can be deployed over a wide range of deployments [copy, delete, confirm, and so on...]

I have updated my previous Reg Import script to ioa747's format, and that import script is working fine.

However, I am unable to get the export script to work!

First, here is the working import script:

; -----------------------------------------------
; date|time
; -----------------------------------------------
#include <Array.au3>
#include "ExtMsgBox.au3"
; -----------------------------------------------
Opt("MustDeclareVars", 1)
; -----------------------------------------------
Global $iEMBWidth = 1000
Global $iMsgDelay = 2
; -----------------------------------------------
ImportRegKeys()
; -----------------------------------------------
Func ImportRegKeys()
    Local $aSrcPath[] = [ _
            "path to .reg", _
            "path to .reg"]
    ; -----------------------------------------------
    _ArrayColInsert($aSrcPath, 1)
    ; -----------------------------------------------
    For $i = 0 To UBound($aSrcPath) - 1
;~      $aSrcPath[$i][1] = RunWait('reg import ' & $aSrcPath[$i][0], "", @SW_HIDE) ? "...No      " : "...Yes      "
        ConsoleWrite($aSrcPath[$i][0] & @CRLF)
    Next
    ; -----------------------------------------------
    Local $sResult = _ArrayToString($aSrcPath, "")
    ; -----------------------------------------------
    _ExtMsgBoxSet(64, 4, Default, Default, 14, "Segoe UI Semibold", $iEMBWidth)
    _ExtMsgBox(32, " ", " Import Reg Key data...", $sResult, $iMsgDelay)
EndFunc   ;==>ImportRegKeys
; -----------------------------------------------

...and here is the non-working export script:

; -----------------------------------------------
; date|time
; -----------------------------------------------
#include "ExtMsgBox.au3"
#include <FileConstants.au3>
; -----------------------------------------------
Opt("MustDeclareVars", 1)
Opt("MouseCoordMode", 0)
; -----------------------------------------------
Global $iEMBWidth = 1000
Global $iMsgDelay = 2
; -----------------------------------------------
ExportRegKeys()
; -----------------------------------------------
Func ExportRegKeys()
    Local $sSrcDataPath, $sDstDataPath, $sResult = ""
    Local $aSrcData[] = [ _
            "HKEY_CURRENT_USER\Software\Native Instruments", _
            "HKEY_LOCAL_MACHINE\Software\Native Instruments"]
    ; ---------------------
    Local $aDstData[] = [ _
            "D:\App_Install\Digital_Audio\2_GR5\Data\RegKeys\hkcu_ni.reg", _
            "D:\App_Install\Digital_Audio\2_GR5\Data\RegKeys\hklm_ni.reg"]
    ; -----------------------------------------------
    For $i = 0 To UBound($aSrcData) - 1
        $sSrcDataPath = $aSrcData[$i]
        $sDstDataPath = $aDstData[$i]
        ; ---------------------
        $sResult = ShellExecuteWait('REG', 'EXPORT "' & $aSrcData[$i] & '" "' & $aDstData[$i] & '" /Y', "", "", @SW_HIDE) ; Works!
;~      $sResult = ShellExecuteWait('REG', 'EXPORT "' & $aSrcData[$i] & '" "' & $aDstData[$i], "", @SW_HIDE) ? "...No      " : "...Yes      " ; Does not work!
;~      ConsoleWrite($sSrcDataPath & " ==>> " & $sDstDataPath & @CRLF)
    Next
    ; -----------------------------------------------
    _ExtMsgBoxSet(64, 4, Default, Default, 14, "Segoe UI Semibold", $iEMBWidth)
    _ExtMsgBox(48, " ", " Export Reg Key data...", $sResult, $iMsgDelay)
EndFunc   ;==>ExportRegKeys
; -----------------------------------------------

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

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