如何在命令提示符中找到Windows上的本地路径?


当前回答

使用下面的命令

dir | find "Directory"

其他回答

嗯,pwd在Vista上对我有用…

最终编辑:它为我在Vista上工作,因为WinAvr安装了pwd.exe,并将\Program Files\WinAvr\Utils\bin添加到我的路径。

使用下面的命令

dir | find "Directory"

这将在控制台中打印它:

echo %cd%

或者在CMD中粘贴这个命令,那么你会得到pwd:

(echo @echo off
echo echo ^%cd^%) > C:\WINDOWS\pwd.bat
C:\Documents and Settings\Scripter>echo %cd%
C:\Documents and Settings\Scripter

C:\Documents and Settings\Scripter>

对于Unix使用pwd命令

当前工作目录

cd不带参数,相当于Unix/Linux下的pwd。

从输入cd /?:

Displays the name of or changes the current directory.

[...]

Type CD without parameters to display the current drive and directory.