This prints it in the console:
echo %cd%
or paste this command in CMD, then you'll have pwd
:
(echo @echo off
echo echo ^%cd^%) > C:\WINDOWS\pwd.bat
It is cd
for "current directory".
cd
is for "change directory"
cd
alone will print the current working directory, on Linux it will change to your user's home directory without printing anything. So beware if you're looking for something cross platform.
cd
says Displays the name of or changes the current directory.
Open notepad as administrator and write:
@echo %cd%
Save it in c:\windows\system32\ with the name "pwd.cmd" (be careful not to save pwd.cmd.txt)
Then you have the pwd command.
cd ,
it will give the current directory
D:\Folder\subFolder>cd ,
D:\Folder\subFolder
cd
is enough. The comma is useless
,
, ;
, =
are also delimiters just like space and tab, therefore cd ,
is no different from cd =;=
or cd <space>
cd
without any parameters is equivalent to pwd
on Unix/Linux.
From the console output of typing cd /?
:
Displays the name of or changes the current directory.
[...]
Type CD without parameters to display the current drive and directory.
You can just type
cd
it will return you the current path.
In PowerShell pwd
is an alias to Get-Location
so you can simply run pwd
in it like in bash
It can also be called from cmd like this powershell -Command pwd
although cd
or echo %cd%
in cmd would work just fine
hmm - pwd works for me on Vista...
Final EDIT: it works for me on Vista because WinAvr installed pwd.exe and added \Program Files\WinAvr\Utils\bin to my path.
C:\Documents and Settings\Scripter>echo %cd%
C:\Documents and Settings\Scripter
C:\Documents and Settings\Scripter>
for Unix use pwd
command
for Unix use pwd command
useless? Because it's what the OP asked
Use the below command
dir | find "Directory"
dir
is localized
You can simply put "." the dot sign. I've had a cmd application that was requiring the path and I was already in the needed directory and I used the dot symbol.
Hope it helps.
Success story sharing
cd
onlyecho
? Justcd
by itself seems to work fine.cd /?
saysType CD without parameters to display the current drive and directory.