ModifyIni

Modify INI File

Related Topics Link IconRelated Topics

Definition

This command allows you to change a value in an INI file.

It has the same functionality as the command INI file extension (AddIni) but offers more options. This command only modifies one specific key of an INI file section at a time. You can use the command to delete sections, keys or values from an INI file. The command supports all types of variables. The variables are converted to their actual values when the command is executed; for example, %windir% will be converted to the name of the Windows directory.

You cannot use the AddINI, ModifyINI, ModifyOEM and ModifyOEMEx commands to share central files over a network.

If an error occurs while running the command, the script stops. If you want to continue the script if there is an error, enable the setting Continue script despite error in the Script Editor.

Settings

Input

The following input is possible:

  • File
    Enter the name of the file with the extension ".INI"; this can be either an existing file or a new file (that will be created).
  • Section
    Enter the name of the section omitting the square brackets [ ]; this can be either an existing section or a new section (that will be created if it does not yet exist.)
    The named section and all the keys contained will be deleted if you check the  option.

    Delete section from INI file deletes the named section and all the keys contained.
  • Key
    Enter the name of the key omitting an "equals" sign (=); this entry can refer either to an existing key or to a new key (that will be created if it does not yet exist.)

    Delete key from INI file deletes the named key.
  • Value
    Enter the value of the key.

    You can select three options for the command execution:

    Replace old value (if existing)
    This option is selected by default; key values will be created or updated.

    Add value to existing line

    Delete value from existing line

    Select this option (or the Add value to existing line option) to modify the load and run keys in the [Windows] section of the WIN.INI file and other keys that can contain multiple values.

Buttons

  • SysEdit
    Starts the system configuration editor (SYSEDIT.EXE).
    This function is available on 32-bit computers only.
  • Edit File
    Loads the named file into the default editor (NOTEPAD.EXE) if you have not specified another editor.
  • Apply
    Displays the specified INI file in a special viewer where you can select the required lines. Confirm by clicking OK.

Options

Confirm changes
If checked, the user will be prompted to confirm each change to an existing entry.

Disable file redirection on x64 computers
For reasons of compatibilty, Ivanti DSM maps file and registry access to the default storage location for 32 bit applications (provided that the storage location differs from that of 64-bit applications). File access: whenever a 32-bit application attempts to access %windir%\System32, the access is redirected to %windir%\SysWOW64. Registry commands: when accessing HKEY_LOCAL_MACHINE\SOFTWARE the calls are redirected to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node. The x64-switch stops this redirection of file and registry accesses when running the script command on a x64 computer; the eScript command runs on the specified path. CallScript command: the script runs in a 64-bit process.