正在搜索命令提示符参数?

Searching for Command Prompt Parameters?

有没有在一般意义上搜索命令提示符参数的方法。还是我们受制于此类程序的文档?例如,在命令提示符下,我键入资源管理器或记事本...但是如果我将第一个参数作为文件路径,它将为我打开该文件路径...我怎么知道这个参数输入存在,也许还有一堆我不知道的其他参数字段。有没有系统搜索程序参数的方法?

没有。虽然你总是可以尝试 programname /?.

Notepad 仅采用单个文件名或采用 /p filename ...(您可以在注册表中的 txtfiles 打印条目中查看命令)。

这是来自 Windows 98 Explorer 的东西,它还是一样。

Explorer 
explorer [/n] [/e][,/root,object][[,/select],subobject]

None Explorer rooted at the Desktop 
/n Opens a new window. 
/e Explorer View (default if nothing else is on the command line.) 
/root,object Starts Explorer with object the top item (normally Desktop is the top item). Eg: explorer /e,/root,c:\Starts Explorer with the C drive as the only drive available. 
/select,subobject Selects the specified subobject. 

Replaceable parameters are %1 (one) which is the short file or folder name and %l (L) which is the long file name.

/IDLIST
This is an additional parameter that means a Windows internal structure is being passed. eg:

Explorer.exe /e,/idlist,%I
The %I is a replacable parameter representing an IDLIST.

Rooted Views
To open an explorer item that starts with a special folder as the top folder use the following syntax.

Where the special folder is a sub folder of the desktop

explorer /e,root,::{CLSID of special folder}

Where the special folder is a sub folder of another special folder (usually, if not always My Computer) 

explorer /e,root,::{CLSID of parent}/::{CLSID of special folder}

Where the special folder is part of the file system

explorer /e,root,path to folder

See Namespaces on the Icons Page for a list of CLSIDs for special folders.

Examples
Note that /select is inconsistent. Sometime the / is required, sometimes it should be left out, and sometimes it doesn't matter.

Starts explorer with the Windows folder opened and selected.

explorer /e,select,c:\windows
Starts explorer with Windows the top level folder and command opened and selected.

explorer /e,/root,c:\windows,select,c:\windows\command
Starts explorer with Windows the top level folder and Tips.txt showing instead of the file listing.

explorer /e,/root,c:\windows,select,c:\windows\tips.txt
Starts explorer with My Computer the top level folder and all branches except for drives collapsed. 

explorer /e,/root,::{20d04fe0-3aea-1069-a2d8-08002b30309d}
Starts explorer with C:\ the top level folder. 

explorer /e,/root,c:\
Starts the Dial Up Networking folder in folder view.

explorer.exe ::{20d04fe0-3aea-1069-a2d8-08002b30309d}\::{992cffa0-f557-101a-88ec-00dd010ccc48}

在Windows中,程序负责处理它们自己的命令行参数,它们可以按照自己喜欢的任何方式进行处理。 (通常将标记化移交给 C 运行时库,但不是强制性的。)

这为程序员提供了最大的灵活性,但确实意味着如果程序员没有记录命令行,则没有直接的方法在事后对其进行逆向工程。

(UNIX 没有太大区别;标记化由 shell 处理,但其余处理由应用程序负责。相比之下,在 VMS 中,整个命令行处理是由 shell 处理,基于必须嵌入到应用程序中的语法信息。)

应用程序通常会提供命令行语法摘要以响应以下一个或多个选项:

application /?
application -?
application /help
application -help
application --?
application --help

(大致从最常见到最不常见排列;带有两个连字符的变体通常只在从 UNIX 移植的软件中发现。)

我没有寻找实际的统计数据,但我的印象是大多数命令行应用程序(可能 80% 或更多)确实提供了这样的摘要。对于 GUI 应用程序不太常见。

否则,您有时可以通过在可执行文件中查找字符串来找到命令行选项。 Microsoft 提供了执行此操作的实用程序 strings.exe,可从其网站下载。 (当然,知道可能的命令行选项的存在并不一定意味着你就能弄清楚它的作用!)

如果您可以访问源代码,或者精通反汇编,那么如果您足够绝望,那可能会提供另一种选择。