如何克服命令行字符串限制?
我尝试了 msdn 上建议的解决方法,将参数写入文件。但是,我无法从文件传递参数。
编辑 : 我需要运行 bcp 实用程序,以便将(大量)数据导出到平面文件。
Command line has a string limitation as mentioned on msdn and here.
I tried the workaround suggested on msdn, writing the arguments to a file. But, I am unable to pass the arguments from a file.
Edit :
I need to run the bcp utility, in order to export (huge) data to flat files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在运行的可执行文件必须明确支持这一点。例如,C# 编译器允许您
从名为
foo
的文件中加载一些选项。我不相信如果没有您正在运行的命令的支持,这可以轻易被“修复”...您可以编写一个小的包装程序来加载文件并启动进程本身。但是,您必须小心安全处理、传播控制台输入和输出等。如果您控制有问题的应用程序,那么最好直接提供支持。The executable you're running has to support this explicitly. For example, the C# compiler allows you to write
to load some options from a file called
foo
. I don't believe this can easily be "fixed" without support from the command you're running though... it's possible that you could write a small wrapper program which loaded the file and started the process itself. However, you'd have to be careful in terms of security handles, propagating console input and output etc. If you're in control of the application in question, you'd be much better off putting support in directly.