無論如何要搜索一般意義上的命令提示符參數。還是我們挾持這些程序的文檔?例如在命令提示符下,我輸入explorer或notepad ...但是如果我把第一個參數作爲文件路徑,它會爲我打開該文件路徑...我怎麼知道這個參數輸入存在,也許有我不知道的一堆其他參數字段。無論如何要系統地搜索程序參數?搜索命令提示符參數?
1
A
回答
1
在Windows中,程序負責處理他們自己的命令行參數,並且他們可以以任何他們喜歡的方式進行操作。 (通常將標記化處理交給C運行時庫,但不是強制性的。)
這給了程序員最大的靈活性,但確實意味着如果程序員沒有記錄命令行,則沒有直接的方法來反向事後處理它。 (UNIX並沒有太大的不同;標記化是由shell來處理的,但其餘的處理是應用程序的責任;而在VMS中,相比之下,整個命令行處理由shell處理,基於必須被嵌入在應用程序的語法信息)
它是常規的用於應用程序響應於一個或多個以下選項提供命令行語法總結:
application /?
application -?
application /help
application -help
application --?
application --help
(大致從最常見到最不常見的安排;帶有兩個連字符的變體通常只能在sof中找到已經從UNIX移植tware。)
我沒有看過實際的統計數據,但我的印象是,大多數的命令行應用程序(可能是80%或更多)也提供了這樣的總結。 GUI應用程序不太常見。
如果做不到這一點,你有時可以通過尋找可執行文件中的字符串find命令行選項。微軟提供了一個實用工具,可以從他們的網站下載這個工具,strings.exe
。 (當然,知道一個可能的命令行選項的存在並不一定意味着你能夠弄清楚它的功能!)
如果你有權訪問源代碼,或者擅長反彙編如果你足夠絕望,這可能會提供另一種選擇。
1
不,儘管您可以隨時嘗試programname /?
。
記事本只需要一個單一的文件名或採取/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}
相關問題
- 1. 搜索文件命令提示符
- 2. javac命令提示符參數
- 3. 參數 - 命令提示符C++
- 4. Schtaks - 命令提示符參數
- 5. 參數和命令提示符
- 6. 從命令提示符指定命令行參數
- 7. 通過命令提示符搜索整個域的文件
- 8. Visual Studio命令提示符與常規命令提示符?
- 9. 命令行參數以flex的形式搜索字符串
- 10. Ruby命令提示符命令
- 11. del命令在命令提示符
- 12. 模擬命令提示符命令
- 13. 運行命令提示符命令
- 14. 命令提示符腳本命令「cd」
- 15. 我要打開新的命令提示符和插入參數的命令提示符
- 16. 命令提示符Python
- 17. C++命令提示符
- 18. Laravel命令提示符FatalErrorException
- 19. 命令提示符輸入
- 20. 命令提示符下wshShell.Run
- 21. 使用命令提示符
- 22. 刪除命令提示符
- 23. 命令提示符Runas cscript
- 24. Qt - Qt命令提示符
- 25. Node.JS命令提示符
- 26. Java命令提示符
- 27. Findstr命令提示符
- 28. 打開命令提示符
- 29. 使用命令提示符
- 30. 使用命令提示符
鏈接到strings.exe https://technet.microsoft.com/zh-cn/sysinternals/bb897439.aspx – CodeCamper 2015-03-21 05:03:52