Importing and exporting Reg Files

Last modified by Jannis Klein on 2024/08/13 08:28

Initial Situation

You can use the "modify registry value" Client Command module to edit or reset individual registry values. However, if you want to customise or change multiple registry values in a bundle, you can use the Shell Execute Command module to import a registry file.

To do this, you must import a registry file that you have already created or exported. You can export this file from the registry of a sample client and then import it again for all the other clients. This not only saves time, but also ensures that consistent values and parameters are passed.

As well as importing a registry file, you can also export it. Exporting the file allows you to copy the specified keys, entries and values from the local computer and transfer them to another Server or Client. This is useful, for example, if you want to use the operating system settings on other computers.

This use case lists both approaches to importing and exporting a registry file. Both sections can be used independently. Proceed as follows:

Import Reg file

Select script

  1. Navigate to the Client Commands > Create module.
  2. Click Add on the ribbon bar. The Client Command Editor will open and you will need to decide whether it is a console or client script. In this case select Client Script.

Inserting and customising a Command Action Group

  1. First select the Miscellaneous > Action Group Command from the Command List. You need this command to structure the script and make it easier to read.
  2. Double click on the Command to open it.
  3. Enter a name for the action in the Description field, e.g. „Import reg file“.
  4. Click OK.
    The frist Command in row 1 appears.

To insert and customise a Download File

  1. Navigate back to the command list and select the File Repository > Download File Command.

    Hinweis  Note:  

    Indent this command, either using the quick selection bar or the CTRL + -> shortcut, so that it appears below the first command (Action group) is displayed. When adding this command, you can also simply drag the command onto the line of the Import Reg file, which will insert it correctly. 

  2. Open the Command and click on the General tab.
  3. In the Description of action box, enter a name, for example „Download file“.
  4. Switch to the Find file(s) tab.
  5. Click on the icon in the Select file(s) field. The File Repository window opens.
  6. Upload the previously exported logging.reg file to the „Private“ directory. Once the file has been uploaded, mark the file for downloads. To do this, tick the box in front of the file name.
  7. Click Close to return to the previous window.

    Hinweis  Note:  

    By uploading to the home directory you ensure that the file can only be used for the current Client Command. The reg file you download here will be synchronised to the deployed file repositories.

  8. Enter the %PROJECTDIR% variable in the Memory as area. This uses a temporary target directory which is automatically cleaned up by the ACMP Client at the end of the Client Command runtime. This means that you do not need to manually remove the files after import.

64_Use Case_Client Command_Reg-Dateien_Download File_708.png

Customised command download file

    9. Click OK to display the Command in row 2.

Inserting and editing the Shell execute command

  1. Load the Shell execute command (Processes and Shell) into the script by double-clicking it in the command list, just like the previous commands.
    Optional: If you are working with the Action group Command, you will need to indent the Shell execute command. This helps with the readability and structure of the client commands. If you have already done this, you can skip this step.
  2. Open the General tab.
  3. Enter a name under the description of the action, e.g. „Run Command“.
  4. Switch to the Details tab.
  5. Enter a filename and parameters in the call options.
  6. Enter the following information in the fields:
Filenamereg.exe or the file path

Hinweis  Note:  

By default, reg.exe is located in the C:\Windows\System32\reg.exe path.

Parameterimport "%PROJECTDIR%logging.reg“

64_Use Case_Client Command_Reg-Dateien_Shell execute command import_708.png

Customised command Shell execute command

    7. Confirm the entries with OK.
        Line 3 is inserted.
    8. Now save the Client Command if you do not want to make any more changes to the content.

If you just want to import a reg file, these three commands are sufficient. Save the Command and proceed with the Client Command phases.

64_Client Command Use Case_Reg  export_1350.png

Client Command Editor: Importing a Reg File

Running the Client Command Phases

The Client Commands must then go through the Test, Synchronise, Release and Execute phases before they can be used. Only then can the Reg files be imported.

Export Reg file

Select script

  1. Navigate to the Client Commands > Create module.
  2. Click Add in the ribbon bar The Client Commands Editor will open and you will need to decide whether it is a console or Client Script. In this case select Client Script

Inserting and customising a Command Action Group

  1. From the Command List, select the Miscellaneous > Action Group Command.
  2. Double click to open the Command..
  3. In the Description of the action box, type a name, e.g. „Export reg key to reg file“.
  4. Click OK.

Inserting and editing a command Shell execute command

  1. From the Command List, select Processes and Shell > Shell Execute command.
    Optional: Note that this command should be indented below the previous one. You can do this using either the CTRL + -> shortcut or the arrows in the toolbar. 
  2. In the General tab, enter a description of the action, e.g. "Run command".
  3. Switch to the Details tab.
  4. Under File name, enter the Reg file to be used for the export, e.g. "reg.exe".
  5. Enter the value export for the parameter together with the path HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Aagon\ACMP "C:\Temp\export.reg". The full parameter must therefore be: export HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Aagon\ACMP "C:\Temp\export.reg".

64_Use Case_Client Command_Reg-Dateien_Shell execute command export_708.png

Custom Shell execute command

    6. Confirm your entries with OK.

Once you have inserted all the relevant blocks to create an export for a reg file, the Client Command Editor interface should look like this:

64_Client Command Use Case_Reg  export_1350.png

Client Command Editor: Exporting a Reg File

Speichern Sie nun das Client Command ab, sollten Sie keine inhaltlichen Änderungen mehr vornehmen wollen.
 

Client Command-Phasen durchlaufen lassen

Finally, the Client Command must go through the Test, Synchronise, Release and Execute phases before it can be used. Only then can the Reg files be exported.

© Aagon GmbH 2024
Besuchen Sie unsere neue Aagon-Community