Edit-OemLine
Edit-OemLine
This command is specific to ASCII/ANSI files, such as AUTOEXEC.BAT and CONFIG.SYS. These files do not support the "Windows Ini-File syntax" (file > section > key > value), so commands must be specified more precisely.
The command works with placeholders in all text fields, but there are no restrictions on the use of placeholders as in Shell operations. For example, constructions such as *TEST* are possible, the TEST character string is found regardless of the characters before and after it (InString search function). Comment lines (REM...) are ignored, since otherwise there may be confusion between documentation and actual commands.
Settings:
- File
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.
- Action
Specifies the action to be performed on file. - Insert line
Inserts a line. - Delete line
Deletes a line. - Replace line
Replaces an existing line. - New line
The content to be inserted, deleted or replaced. - Instance
- All
Executes the action on all occurrences of the line in the file. - First possible position
Executes the action on the first occurrence of the line in the file. - Last possible Position
Executes the action on the last occurrence of the line in the file. - Position
- After line
Specifies that the action is performed on text after the specified line. - Before line
Specifies that the action is performed on text before the specified line. - 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 adds an entry for the host chisv01.solys.local to the HOSTS file at C:\Windows\System32\Drivers\etc.
Corresponds to DSM eScript command:
- ModifyOEM
See also:
- Add-EnvironmentPath
- Add-OemEnvironmentPath
- Edit-OemText
- Merge-IniFile
- Set-FileReplaceText
- Set-XmlNode
- Write-IniFileValue