windows 需要在命令提示符下导航到文件夹
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5576321/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Need to navigate to a folder in command prompt
提问by the_dopamine
My command prompt starts in C:\Users\ (Name) and I need it to be in a different folder, how can I do this using the command prompt itself?
我的命令提示符从 C:\Users\(名称)开始,我需要它位于不同的文件夹中,如何使用命令提示符本身来执行此操作?
回答by Andrew
Navigate to the folder in Windows Explorer, highlight the complete folder path in the top pane and type "cmd" - voila!
导航到 Windows 资源管理器中的文件夹,突出显示顶部窗格中的完整文件夹路径并键入“cmd” - 瞧!
回答by mousio
I prefer to use
我更喜欢使用
pushd d:\windows\movie
because it requires no switches yet the working directory will change to the correct drive and path in one step.
因为它不需要开关,工作目录将一步更改为正确的驱动器和路径。
Added plus:
添加加号:
- also works with UNC paths if an unused drive letter is available for automatic drive mapping,
- easy to go back to the previous working directory: just enter
popd
.
- 如果未使用的驱动器号可用于自动驱动器映射,则也适用于 UNC 路径,
- 很容易回到以前的工作目录:只需输入
popd
.
回答by user1686
In MS-DOS COMMAND.COM
shell, you have to use:
在 MS-DOS COMMAND.COM
shell 中,你必须使用:
d:
cd \windows\movie
If by chance you actually meant "Windows command prompt" (which is not MS-DOS and not DOS at all), then you can use cd /d d:\windows\movie
.
如果您碰巧实际上是指“Windows 命令提示符”(它根本不是 MS-DOS,也不是 DOS),那么您可以使用cd /d d:\windows\movie
.
回答by Richard Schneider
Just use the change directory (cd) command.
只需使用更改目录 (cd) 命令。
cd d:\windows\movie
回答by mor222
To access another drive, type the drive's letter, followed by ":".
要访问另一个驱动器,请键入驱动器的盘符,后跟“:”。
D:
Then enter:
然后输入:
cd d:\windows\movie
回答by Dave
When I open a "DOS" command prompt, I use a batch file which sets all of the options I need and adds my old-time dos utilities to the path too.
当我打开“DOS”命令提示符时,我使用一个批处理文件来设置我需要的所有选项并将我的旧 dos 实用程序也添加到路径中。
@set path=%path%;c:\utils
@doskey cd=cd/d $*
@cd \wip
@cmd.exe
The doskey line sets the CD command so that it will do both drive and folder simultaneously. If this doesn't work, it is possibly because of the version of windows that you're running.
doskey 行设置 CD 命令,以便它同时执行驱动器和文件夹。如果这不起作用,则可能是因为您运行的 Windows 版本。