SyntaxFix
Write A Post
Hire A Developer
Questions
for /f "delims=" %%i in ("%0") do set "curpath=%%~dpi" echo "%curpath%"
or
echo "%cd%"
The double quotes are needed if the path contains any & characters.
&