Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Could anyone tell me how I can print the current working directory with forward slashes, not backslashes, from the Windows command line?


UPDATE: preferably I would like to do this without downloading any special utilities, but that may not be possible.

share|improve this question

You can do substitutions like this:

C:\WINDOWS\System32>echo %CD:\=/%
share|improve this answer
+1 Nice, I didn't know you could do this. – Bryan Mar 2 '11 at 23:56
I recommend typing CMD /? to a command prompt and reading the result. Do the same thing with other commands that get special mentions, but IF, SET, and FOR all have little gems hidden in their options. – RBerteig Mar 3 '11 at 6:36

You could download GNU utilities for Win32 and use sed.

pwd | sed -e 's!\\!/!g'


Disclaimer, I don't have a windows PC in front of me to test this, but I have used sed on windows to solve similar problems.

share|improve this answer
thank you! ideally i'd like to do this without downloading anything - i'll hang on and see if anyone else suggests anything, otherwise will accept this. – Steve333 Mar 2 '11 at 22:40
The GNUWin32 utilities are pleasant to have around because they can reduce friction just enough for small things like this. They are light weight too, its not a huge commitment like an installation of Cygwin would be. – RBerteig Mar 3 '11 at 6:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.