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.

How to Read a Parameter that Contains Percent Signs in an INI File

Keywords:	INIReadPvt percent %

Question:

I'll try to keep this simple... Want to read the following from an INI
[main] 
File1=%WinDir%netlog.exe
The following is defined in the WBT...
WinDir=DirWindows(0)
FirstFile=IniReadPvt("Main","File1","",FcompareINI)
What I get for the value of File1 is %WinDir%netlog.exe NOT c:\winnt\netlog.exe

Since the WinDir may not always be the same, I'd like to be able to change it if I need to. Any ideas??

Answer:

The substitution stuff only works for Winbatch source code, not data it reads from other sources. You have to do it yourself. Try...
[main] 
File1=%WinDir%netlog.exe
And the WBT:
WinDir=DirWindows(0)
FirstFile=IniReadPvt("Main","File1","",FcompareINI)

FirstFile=StrReplace(FirstFile,"%%WinDir%%",WinDir)

Article ID:   W13342
Filename:   Read Parameters that contain Percents in INI Files.txt
File Created: 1999:04:15:16:53:22
Last Updated: 1999:04:15:16:53:22