20 ms·
> The cd command is also buggy: It doesn't work for directories located on CD/DVD drives (You can however still access content on CD/DVD using direct paths): >
by BoppreH 4y ago
> The cd command is also buggy: It doesn't work for directories located on CD/DVD drives (You can however still access content on CD/DVD using direct paths):
> cd d:\
That's not a bug, is it? `cd` requires the `/d` flag to switch drives, or you can just type the drive letter name.
https://superuser.com/questions/135214/using-cd-command-in-windows-command-line-cant-navigate-to-d https://superuser.com/questions/135214/using-cd-command-in-w...
- chrisfinazzo 4y ago
- deleted 4y ago[deleted]
- duffyjp 4y agoLast night I tried updating some Wifi drivers on Windows 10, and clicking the classic "Have Disk" button defaulted to A:\
- blowski 4y agoI remember changing the A: to Z: and feeling like some hacker genius.
- 2143 4y agoSigned, Federation of Linux & Unix (incl. Mac) users (I don't know the scheme in Plan9, Solaris etc)
- Aloha 4y agoSolaris is Unix for the purposes of this discussion.
- chrisfinazzo 4y agoSince you brought it up, what’s the output of uname -a on Solaris 11?
- Aloha 4y agoI think it'd be SunOS something 5.11
- vorpalhex 4y agoThis is the Posix standard which also includes BSD et al.
- jordemort 4y agoYeah, in DOS & Windows, each drive has its own working directory. "cd d:\" changes the working directory for D: but keeps the current drive as C: # Change directory C:\> cd WINDOWS # Switch drive C:\WINDOWS> D: # Change directory again D:\> cd DATA # Switch drive again D:\DATA> C: # It remembered that we were in WINDOWS on C: C:\WINDOWS> # Change directory on D: C:\WINDOWS> cd D:\POTATO # That didn't change the directory for our shell C:\WINDOWS> # Switch over to D: C:\WINDOWS> D: # It did change the directory for D:, though D:\POTATO>
- cesarb 4y ago> Yeah, in DOS & Windows, each drive has its own working directory. On Windows, no, it doesn't, it's an illusion maintained by CMD using environment variables, for compatibility with DOS. Quoting Raymond Chen (https://devblogs.microsoft.com/oldnewthing/20100506-00/?p=14133 https://devblogs.microsoft.com/oldnewthing/20100506-00/?p=14...): "Win32 does not have the concept of a separate current directory for each drive, but the command processor wanted to preserve the old MS-DOS behavior because people were accustomed to it (and batch files relied upon it). The solution was to store this “per-drive current directory” in the environment, using a weird-o environment variable name so it wouldn’t conflict with normal environment variables."
- mynameisvlad 4y agoI mean, functionally the parent comment is accurate. There is a working directory kept for each drive. Just because in Windows it's done using environment variables doesn't mean that the net experience isn't "each drive has a working directory".
- deleted 4y ago[deleted]
- skissane 4y ago> I mean, functionally the parent comment is accurate. Not really-this is something only cmd.exe does-not the Windows APIs, not any other Windows program (well, any other program could support the same undocumented environment variables as cmd.exe does, but very few do-I’m not aware of any). If someone mistakenly thinks this is how Windows works, as opposed to only one small component of it, they are going to get confused at some point.
- malkia 4y agojust use "pushd" instead of "cd" - as bonus you get directories saved to stack that you can "popd", much like unix.
- malkia 4y agoI often start my .bat/.cmd files with @echo off pushd "%~dp0" e.g. no matter from where, ensure that the current folder is the folder of the .bat/.cmd file