I am parsing INI files for entries used to launch other processes. A stripped-down example of such a file might be: [global]
command=wscript.exe
commandline="c:\some folder\with spaces\myscript.vbs" I'm using IniRead to grab these values like so: $commandName = IniRead("test.ini", "global", "command", "")
$commandParams = IniRead("test.ini", "global", "commandline", "")
$fullCommand = $commandName & " " & $commandParams
ConsoleWrite($fullCommand) However IniRead is stripping the quotes from the value, so the output of the script is: wscript.exe c:\some folder\with spaces\myscript.vbs In the full script this fails because wscript.exe tries to load a script called "c:\some". If, however, I have a value that doesn't start and end with a quote, the path is quoted as expected. An example of an INI file that would work: [global]
command=wscript.exe
commandline="c:\some folder\with spaces\myscript.vbs" scriptinput.txt The output when using this as input is: wscript.exe "c:\some folder\with spaces\myscript.vbs" scriptinput.txt Is this expected behaviour? If so, does this mean I'm going to have to write my own INI parser to work around this behaviour? (Note that the INI files are from an old system, which is why I can't just alter the input file format).