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

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

问题描述

我一直工作在一个小而简单的程序,我将文件拖放,并根据certian规则,他们被转移到不同势的地方。



程序除非我的降幅超过了一些文件的详细工作正常,那么它踢回一个错误(这似乎是比什么都重要Windows)中的启动命​​令C:\myapp.exe \file \file \file太长。



我知道我可以成立一个背景proccess,但我真的希望这个节目不是在底色上运行(其中,这将是闲置的大部分的时间)。



有没有解决这个限制?


解决方案
<办法p>如果你想对于Windows资源管理器中删除文件,比你能实现自己的投递处理程序作为外壳扩展处理程序(见的 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 )给出(滴处理程序示例一点点其他的用例,但剂量没有关系)。



对于降外壳扩展名处理的程序将获得的全部信息所有丢弃的文件和你不必开始的所有文件像参数命令子程序。


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.

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).

Is there a way around this limitation?

解决方案

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).

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天全站免登陆