Write-IniFileValue

This command processes individual values in INI files. The command works in the same way as the Merge-IniFile command, but offers more options and only processes a specific key of a defined section of an INI file. It can also be used for delete operations. The command supports all types of variables. The variables are converted to their current values when the command is executed, for example, ${env:SystemRoot} becomes the Windows directory.


Settings:

  • File
    INI file to be changed. The use of variables is possible. Use the "..." button to select an existing file (on the packaging system) or enter the path manually. A file that does not yet exist is created.
  • Section
    Name of the section. The name is given without the square brackets and can refer to both an existing and a non-existing section. A section that does not yet exist is created.
    If "Delete section from INI file" is checked, the specified section is deleted with all its keys.
  • Key
    Name of the key. This is specified without the equals sign and can refer both to an existing key and to a key that does not yet exist. A key that does not yet exist is created.
    If "Delete key from INI file" is selected, the specified key is deleted.
  • Value
    Value of the key specified above.
    • Replace value (if one exists)
      Standard function: Key value is created or updated.
    • Add value to existing line
      Appends an additional value to an existing line
    • Delete value from existing line
      Deletes the value from an existing line
  • Confirm modify
    If selected, the user must confirm the modification of an existing entry in a dialog box.
  • Use 32-Bit mode on x64 computer
    If the script is executed on a 64-bit operating system, the counterpart for 32-bit applications SysWOW64 can be used automatically when referring to the SYSTEM32 directory.


Example:

The following example sets the language to English via the Greenshot INI file in the user's profile directory.


Corresponds to DSM eScript command:

  • ModifyIni


See also: