I am programmatically generating a command to be submitted to cmd.exe using Runtime.getRuntime.exec() from java.
The command is tortoiseproc ignore command of the form
tortoiseproc /command:ignore /path:file1*file2*file3*...................filen
As you can see, the path parameter takes a number of files and problem occurs when this string exceeds a certain length approx. 8197 characters as documented in microsoft KB for cmd.exe.
The workaround there says that modify the program so that it accepts the parameters from a file rather than from the commandline string. Does anybody know how to pass parameters to tortoiseproc.exe via file?
I had same problem and this is my solution for that:
after file is created I use
Nope, that's not possible. However, in this specific case, it doesn't matter: you can split the file list into multiple smaller ones, and run the tortoiseproc multiple times. Example:
and so on, up to file n.
you can pass a file in utf16 format, with each file listed on a separate line.
Pass the path to that file with
/pathfile:"path/to/file.txt"