如何绕过命令行长度限制? [英] How to get around the command line length limit?

查看:178
本文介绍了如何绕过命令行长度限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在开发一个小而简单的程序,我把文件放到上面,并根据certian规则,他们被移动到不同的地方。

I've been working on a small and simple program that I drop files onto and, based on certian rules, they are moved to diffrent places.

程序工作正常,除非我删除多个文件,然后它启动一个错误(似乎是更多的Windows比任何)启动命令c:\myapp.exe \file \file \file太长了。

The program works fine unless I drop more than a few files, then it kicks back an error (that appears to be more Windows than anything) that the start up command "c:\myapp.exe \file \file \file" is too long.

我意识到我可以设置一个后台进程,但我真的更喜欢这个程序不能在后台运行

I realize I could set up a background proccess, but I really would prefer that this program not run in the backround (where it would be idle most of the time).

推荐答案

p>如果要关于Windows资源管理器删除文件,您可以实现您自己的Drop处理程序作为Shell扩展处理程序(请参阅 http://msdn.microsoft.com/en-us/library/cc144165(VS.85).aspx http://msdn.microsoft.com/en-us/library/bb776797.aspx )。在 http://www.codeproject.com/kb/shell/shellextguideindex.aspx你会发现一个很好的介绍如何写这样的扩展。第VI部分(请参阅 http://www.codeproject.com/kb/shell/ShellExtGuide6 .aspx )给出了Drop Handler的一个例子(对于一些其他的用例,但它并不重要)。

If you want to drop files with respect of Windows Explorer, than you can implement your own Drop Handlers as a Shell Extension Handlers (see http://msdn.microsoft.com/en-us/library/cc144165(VS.85).aspx and http://msdn.microsoft.com/en-us/library/bb776797.aspx). On http://www.codeproject.com/kb/shell/shellextguideindex.aspx you will find a good introduction how to write such extensions. The part VI (see http://www.codeproject.com/kb/shell/ShellExtGuide6.aspx) gives an example of Drop Handler (for a little other use case, but it dose not matter).

关于Drop Shell扩展处理程序您的程序将收到所有删除的文件的完整信息,您不需要启动一个子程序,所有的文件作为命令参数。

With respect of Drop Shell Extension Handler your program will receive full information about all dropped files and you need not start a child program with all the files as command like parameters.

这篇关于如何绕过命令行长度限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆