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.exeThe 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.exeSince 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.exeAnd the WBT:WinDir=DirWindows(0) FirstFile=IniReadPvt("Main","File1","",FcompareINI) FirstFile=StrReplace(FirstFile,"%%WinDir%%",WinDir)
Article ID: W13342Filename: Read Parameters that contain Percents in INI Files.txt