双击一个文件提供"调试和QUOT;作为第二个参数? [英] Double clicking a file gives "debug" as second parameter?

查看:167
本文介绍了双击一个文件提供"调试和QUOT;作为第二个参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我双击某个文件启动的应用程序的参数是根据Process Explorer的:

When I double click a certain file the arguments for the launched application are according to Process Explorer:

C:\\ Program Files文件(x86)的\\ MiKeSoft \\ PCG TOOLS \\ PcgTools.exe调试D:\\ Muziek \\ Korg的\\工作站\\克罗诺斯\\声音和Templates_Commercial \\ KRS \\ KRS-03 \\ KRS-03.PCG

"C:\Program Files (x86)\MiKeSoft\PCG Tools\PcgTools.exe" debug D:\Muziek\Korg\Workstations\Kronos\Sounds and Templates_Commercial\KRS\KRS-03\KRS-03.PCG

为什么有调试的第二个参数?

How come there is debug as second argument?

推荐答案

文件关联使用说明应执行的命令行的字符串在注册表中设置。该字符串可以包含除%1 占位符的文件名任意其他参数。

File associations are set in the registry using a string describing the command line that should be executed. That string can contain arbitrary additional parameters in addition to the %1 placeholder for the filename.

如果该字符串是像 PcgTools.exe调试%1 你会得到像你所观察到的一个命令行。

If the string is something like PcgTools.exe debug %1 you'll get a command line like the one you observed.

由于雷蒙德指出,如果不附上%1 在引号,shell将不插入它们,即使文件名中包含空格。默认的命令行,然后解析会将单一文件名作为多个参数,通过空间分割,所以你通常要使用%1

As Raymond notes, if you don't enclose %1 in quotation marks, the shell will not insert them, even if the filename does contain spaces. The default command line parsing then treats that single filename as multiple parameters split by space, so you typically want to use "%1".

在你的情况有没有周围的文件名,所以我猜你的程序使用%1 非标准的命令行解析。一些(主要是较旧的)程序这样的表现,但我建议不要它自己的程序,使用%1并为他们标准的解析。

In your case there are no " around the filename, so I guess your program uses %1 is non standard command line parsing. Some (mostly older) programs behave like this, but I recommend against it for your own programs. Use "%1" and standard parsing for them.

这篇关于双击一个文件提供"调试和QUOT;作为第二个参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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