0

In windows (7 & 8+) under file explorer, special Windows directories shows as really special, "Documents", "Downloads", etc, without any parent director, making it hard for people to figure out from that where they actually is. And make it hard to use such directories under DOS too:

C:\>cd Documents
The system cannot find the path specified.

C:\>cd \Documents
The system cannot find the path specified.

For such special Windows directories, in there any generic ways to cd into them under DOS, without specifically using my windows ID (c:\user\MyID)?

xpt
  • 8,651

1 Answers1

3

You could use the USERPROFILE environment variable like:

cd "%USERPROFILE%"\Documents
Eric Renouf
  • 1,764
  • There has been a discussion of another environment variable could also be used, and also why it is not the best candidate. But strangely it was covertly deleted, by someone with extreme power. So unhelpful and creepy. – xpt Dec 28 '17 at 20:02
  • I believe the quotation marks are unnecessary. Even if the username contains a space, the directory change will still work correctly. – davidmneedham Dec 29 '17 at 15:49
  • @davidmneedham that may be, but I find I only get myself into trouble if I start looking for times when I can avoid quotes, and almost never get into trouble for including them. – Eric Renouf Dec 29 '17 at 15:51