Question / Problem
I'm using the following batch script to start TreeSize scans with paths that are defined in a text file. TreeSize however doesn't produce the report!
FOR /F %%p IN (Paths.txt) DO START /WAIT "C:\Program Files\JAM Software\TreeSize Professional\TreeSize.exe" /EXCEL "report.xls" "%%p"
Answer / Solution
This is a common mistake when using the START command in batch files. The START command will interpret the first quoted string after the command as a title for the new command prompt instance. As the path to the TreeSize executable is quoted here, this will be the title for the cmd instance. Of course, the batch script won't work this way.
To be able to use quoted paths, you will have to pass a dummy title after the START command first. The following example script will work as expected:
FOR /F %%p IN (Paths.txt) DO START /WAIT "DummyTitle" "C:\Program Files\JAM Software\TreeSize Professional\TreeSize.exe" /EXCEL "report.xls" "%%p"