Saturday 28 August 2010

Changing Directory in a Windows Command Box

I've found that with a Vista machine the cd command in a command box won't change directory from one drive to another, so If I open a command box on Drive C - where the command prompt in accessories always opens it, I can't get to any folder on drive D, though cd D:\ does not produce an error signal. It does provoke an error signal if I try to move to a non-existent folder on drive D, but not if I try to move to a folder that is there, so there seems to be a sort of unconscious awareness of drive D

The only way I can open a command box that can get at Drive D is to go to drive D and run a batch file from there, and then that command box can't (consciously?) see Drive C.

I wonder what proportion of Windows users know what a batch file is ?

3 comments :

Ged said...

Remember that the command to change drive is *separate* from the command to change directory in Windows. So you need to say something like:

D:
cd \some\directory\or\other

Ged said...

Another thing: Windows maintains a "current" directory for *each* logical drive. So something like:

cd e:\adobe

tells windows to change the current directory for drive e: to \adobe, irrespective of whether you are currently "on" e: or not. Thus you can change directory *before* changing drive!

Richard said...

What a fount of wisdom you are !!

Is there somewhere a reference manual of permitted commands ?

They seem be MSDOS commands, which were an enfeebled subset of Unix commands, but when I hopefully guess, I often find the command I want isn't available.