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


当前回答

cd ,

它将给出当前目录

D:\Folder\subFolder>cd ,
D:\Folder\subFolder

其他回答

在PowerShell中,pwd是Get-Location的别名,所以你可以像在bash中那样简单地运行pwd

它也可以从cmd中调用,比如powershell -Command pwd,尽管cmd中的cd或echo %cd%也可以

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.

你可以简单地写上"。"点号。我有一个cmd应用程序,需要路径,我已经在需要的目录,我使用点符号。

希望能有所帮助。

以管理员身份打开记事本,写下:

@echo %cd%

保存在c:\windows\system32\ 以“pwd”命名。Cmd "(注意不要保存pwd.cmd.txt)

然后是pwd命令。

C:\Documents and Settings\Scripter>echo %cd%
C:\Documents and Settings\Scripter

C:\Documents and Settings\Scripter>

对于Unix使用pwd命令

当前工作目录