WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

System INI and INI File Topics

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

INI and INI Private Commands

Keywords: INI and INI Private Commands IniWritePvt IniReadPvt IniRead IniWrite

When using the INI Private commands, WinBatch always assumes that the INI file is in the Windows directory unless a full path is specified.

Precautions when using INI operations:

Do not mix file operations and INI operations. This is not a feature of WinBatch but of Windows. When you use iniWritePvt() to update an INI file, Windows broadcasts a message to everybody so that processes that have read the INI file know that the file needs to be re-read. Overwriting an INI file with File operations doesn't result in this broadcast. As a result, nobody, including WinBatch, will know that the file is changed, and everybody, including WinBatch, will use its buffered copy to continue processing.

Forcing a disk update of an ini file

If you use the IniWrite or IniWritePvt functions to update an ini file, Windows will take its own sweet time to update the copy of the file on disk. There is a trick to tell Windows to update the copy now.
   IniWritePvt("","","","filename.ini") 
or
   IniWrite("","","")
By making the first three parameters null strings, it tells windows that you wish the ini file to be updated on disk NOW. That tells windows to write the cached ini file out to disk *right now*. Then you can use File Operations and get your changes.
Article ID:   W13338
Filename:   IniWrite and IniWritePvt commands.txt
File Created: 1999:04:15:16:53:20
Last Updated: 1999:04:15:16:53:20