Page 1 of 1

Get current directories

Posted: 10 Dec 2018 15:53
by Q. April
What a simple way to get current directories

Code: Select all

@echo off>Temp&for %%a in ("Temp.*") do ( set "_Dir=%%~par" )&Del Temp
It worked ,but the code really long , any simple way to do it?

Re: Get current directories

Posted: 10 Dec 2018 15:55
by ShadowThief

Code: Select all

echo %CD%

Re: Get current directories

Posted: 10 Dec 2018 16:00
by Q. April
:D thanks

Re: Get current directories

Posted: 10 Dec 2018 16:15
by Squashman
You can also just type the CD command.

Code: Select all

H:\temp\temp>cd
H:\temp\temp