我怎样才能在一个特定的位置打开一个cmd窗口,而不必一直导航到我想要的目录?
当前回答
最简单的方法是进入Windows资源管理器的地址栏,在那里输入cmd。它将自动为您打开命令提示窗口。
其他回答
我看到有很多答案,有些相当复杂:),看到它们很奇怪。你只需要打开任何windows文件夹窗口,导航到你想要的文件夹,并专注于地址栏,输入“cmd”并按enter,你将会直接显示新的命令提示符窗口,其中包含我们已经在windows文件夹窗口中导航的文件夹路径或位置。 如果你想看清楚这些步骤的图像,你可以检查
如何直接打开特定文件夹中的命令提示符
用一个只有一行的批量文件:
START "Desire_Path" //不带引号用cmd输入你想要开始的位置
示例(打开文本编辑器,将代码放在那里,并以.bat扩展名保存文件):
START cd C:\Users
然后双击它
****注意:如果你想让资源管理器完成任务,不要放CD命令。
*做相反的事情:
为了让你在使用cmd时使用explorer.exe应用程序打开一个特定的目录,你可以使用START命令和你想显示的文件夹的绝对路由。
在Windows 8系统中,你可以点击地址栏,输入“cmd”(不带引号),然后回车。这将在当前路径中打开cmd窗口。
右键单击桌面,导航到新建,然后从子菜单中选择“快捷方式”→浏览到Windows目录(或文件夹),然后浏览到system32目录,单击确定。
在命令字符串中添加\和"cmd.exe"(不带引号)。它应该是这样的:
C:\WINDOWS\System32\cmd.exe.
单击下一步并完成。右键单击桌面上的新CMD图标,选择属性,然后单击“开始”旁边。在选项中,删除该行,并将路径添加到您想要它开始的目录…例如,输入C:\temp\mp3,然后单击“确定”。
这将向上下文菜单添加条目,以启动一个自动导航到您所单击目录的命令窗口。
用法:
Right-click a folder icon (or the empty background area inside an already open folder)
and click either "Open in Terminal" or "Open in Terminal (Admin)".
You can also right click files to execute them with a command window.
When the file is done running you are left with a command window that is navigated to the files directory.
Open_in_Terminal.reg
Windows Registry Editor Version 5.00
; Admin versions.
; Right click on a folder in a directory.
[HKEY_CLASSES_ROOT\Directory\shell\OpenCommandWindowHereAsAdministrator]
@="Open in Terminal (Admin)"
"Icon"="cmd.exe"
"HasLUAShield"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\Directory\shell\OpenCommandWindowHereAsAdministrator\command]
@="cmd.exe /c powershell.exe -Command \"Start-Process cmd -Verb runas -ArgumentList '/k pushd \"%1\"'\""
; Right click on nothing in a directory, i.e. the "background" of the directory.
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCommandWindowHereAsAdministrator]
@="Open in Terminal (Admin)"
"Icon"="cmd.exe"
"HasLUAShield"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCommandWindowHereAsAdministrator\command]
@="cmd.exe /c powershell.exe -Command \"Start-Process cmd -Verb runas -ArgumentList '/k pushd \"%V\"'\""
; Right click on nothing in a library directory, i.e. the "background" of the library directory.
[HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\OpenCommandWindowHereAsAdministrator]
@="Open in Terminal (Admin)"
"Icon"="cmd.exe"
"HasLUAShield"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\OpenCommandWindowHereAsAdministrator\command]
@="cmd.exe /c powershell.exe -Command \"Start-Process cmd -Verb runas -ArgumentList '/k pushd \"%V\"'\""
; Right click on a file in a directory.
[HKEY_CLASSES_ROOT\*\shell\OpenWithCommandWindowAsAdministrator]
@="Open in Terminal (Admin)"
"Icon"="cmd.exe"
"HasLUAShield"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\*\shell\OpenWithCommandWindowAsAdministrator\command]
@="cmd.exe /c powershell.exe -Command \"Start-Process cmd -Verb runas -ArgumentList '/k pushd \\\"%W \\\" && \\\"%1\\\"'\""
; Non-Admin versions.
; Right click on a folder in a directory.
[HKEY_CLASSES_ROOT\Directory\shell\OpenCommandWindowHere]
@="Open in Terminal"
"Icon"="cmd.exe"
"Position"="middle"
[HKEY_CLASSES_ROOT\Directory\shell\OpenCommandWindowHere\command]
@="cmd.exe /k pushd \"%1\""
; Right click on nothing in a directory, i.e. the "background" of the directory.
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCommandWindowHere]
@="Open in Terminal"
"Icon"="cmd.exe"
"Position"="middle"
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCommandWindowHere\command]
@="cmd.exe /k pushd \"%V\""
; Right click on nothing in a library directory, i.e. the "background" of the library directory.
[HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\OpenCommandWindowHere]
@="Open in Terminal"
"Icon"="cmd.exe"
"Position"="middle"
[HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\OpenCommandWindowHere\command]
@="cmd.exe /k pushd \"%V\""
; Right click on a file in a directory.
[HKEY_CLASSES_ROOT\*\shell\OpenWithCommandWindow]
@="Open in Terminal"
"Icon"="cmd.exe"
"Position"="middle"
[HKEY_CLASSES_ROOT\*\shell\OpenWithCommandWindow\command]
@="cmd.exe /k pushd \"%W\" && \"%1\""
这需要很多努力,所以如果你觉得慷慨,然后随时发送一个贝宝捐赠,以帮助我克服调试和测试的创伤后应激障碍:)
一个卸载程序,如果你需要:
Open_in_Terminal_Remover.reg
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\shell\OpenCommandWindowHereAsAdministrator]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCommandWindowHereAsAdministrator]
[-HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\OpenCommandWindowHereAsAdministrator]
[-HKEY_CLASSES_ROOT\*\shell\OpenWithCommandWindowAsAdministrator]
[-HKEY_CLASSES_ROOT\Directory\shell\OpenCommandWindowHere]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCommandWindowHere]
[-HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\OpenCommandWindowHere]
[-HKEY_CLASSES_ROOT\*\shell\OpenWithCommandWindow]
推荐文章
- Windows FINDSTR命令的未记录的特性和限制是什么?
- 无法在Windows上从/usr/local/ssl/openssl.cnf加载配置信息
- GIT克隆在windows中跨本地文件系统回购
- 如何运行一个PowerShell脚本而不显示窗口?
- PowerShell:仅为单个命令设置环境变量
- 为什么这个Windows批处理文件只执行第一行,而在命令shell中执行所有三行?
- 环境变量存储在Windows注册表的哪里?
- 有一个好的Valgrind Windows的替代品吗?
- Windows和Linux上的c++编译:ifdef开关
- 如何验证批处理文件中是否存在一个文件?
- 异步运行Windows批处理文件命令
- XAMPP -端口80被PID 4的“无法打开进程”使用!12
- 为什么git在Windows下记不住我的密码
- Git克隆/拉不断冻结在“存储密钥在缓存?”
- 有没有替换Windows (Visual C)的unistd.h ?