簡體   English   中英

在命令提示符下執行 Windows 運行對話框命令

[英]Execute Windows run dialog command in command prompt

在 Windows 運行對話框中,我可以使用命令shell:startup打開用戶的啟動文件夾。

為了能夠使用 Windows 命令行中的命令,我嘗試在命令提示符下輸入shell ,但返回錯誤信息

'shell' is not recognized as an internal or external command,
operable program or batch file.

如何在命令提示符下執行此類運行行命令?

使用 start-command,如下所示:

start shell:startup

你也可以使用開始/? 顯示啟動命令的幫助。

運行對話框不僅接受命令,還接受 URL/URI 或任何真實路徑,從它的描述中可以看出:

運行對話框

這就是為什么當您打開shell:startup這是一個特殊路徑(在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\FolderDescriptions )它正常工作的原因

但是在 Windows cmd 或 PowerShell 中,命令必須是可執行文件、腳本文件或任何其他具有注冊類型的文件。 它不會接受文件夾。 要解決此問題,請使用以下任一方法

start shell:startup
explorer shell:startup

如果路徑包含空格,則在 cmd 中,由於 cmd.exe 中的遺留問題,您必須添加另一個空參數

start "" "shell:common startup"

如果您使用 PowerShell 則start "shell:common startup"將正常工作,因為start是 PowerShell 中Start-Process的別名。 如果您運行explorer管理器,那么您也不需要那個空字符串

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM