logoalt Hacker News

momoraultoday at 2:35 PM1 replyview on HN

Another Windows oddity: each drive letter has its own current directory. D: doesn't mean the root of D:, it means "wherever you last were on D:". Same with C:foo, which is relative to C:'s current directory. DOS baggage that's still around.


Replies

chrismorgantoday at 3:55 PM

And you need `cd /d` to switch drives. This was how I rendered a Windows computer non-bootable for the first time. Ran Command Prompt as admin (because I was logged in as a user that didn’t have write access to D:\backups), and it starts in a rather important directory, then:

  C:\WINDOWS\system32>cd D:\backups\some-huge-directory
  C:\WINDOWS\system32>del /s *
Oops. I learned to look twice before running a big dangerous command. And to use /d.