如何通过文件将参数传递给tortoiseproc.exe?

| 我正在以编程方式从Java使用Runtime.getRuntime.exec()生成要提交给cmd.exe的命令。 该命令是tortoiseproc忽略形式的命令
tortoiseproc /command:ignore /path:file1*file2*file3*...................filen
如您所见,path参数需要多个文件,并且当此字符串超过一定长度时会出现问题。如Microsoft KB中针对cmd.exe记录的8197个字符。 那里的解决方法是修改程序,以便它接受来自文件而不是命令行字符串的参数。有人知道如何通过文件将参数传递给tortoiseproc.exe吗?     
已邀请:
您可以传递utf16格式的文件,每个文件都在单独的行中列出。 用ѭ1将路径传递到该文件     

bab

不,那是不可能的。但是,在这种特定情况下,没关系:您可以将文件列表拆分为多个较小的文件列表,然后多次运行tortoiseproc。例:
tortoiseproc /command:ignore /path:file1*file2*file3*file4
tortoiseproc /command:ignore /path:file5*file6*file7*file8
依此类推,直到文件n。     
我有同样的问题,这是我的解决方案:
using (var s = File.Create(\"D:\\\\p3.tmp\"))
{
    using (var sw = new StreamWriter(s, new UnicodeEncoding(false, false)))
    {
        sw.Write(@\"D:\\SourceCode\\Utils\\ProductProvider.cs\" + \'\\n\');
        sw.Write(@\"D:\\SourceCode\\Utils\\BillingProvider.cs\"+ \'\\n\');
    }
}
创建文件后,我使用
TortoiseProc.exe /command:commit /pathfile:\"D:\\p3.tmp\" /logmsg:\"test log message\" /deletepathfile
    

要回复问题请先登录注册