hi friends.......i'm using XP sp2....when I open cmd the it shows the current directory ie: "D:\Documents and settings\user>"
which is fine and I was able it change the directory using,
cd e: or CD E:
but from yesterday i'm not able to do that...during that i only reinstalled java i.e jdk & jre 6.0.1 from jdk/jre 5.0.10 and made some changes in the "environment variables". now when I try
it changes to drive E: or F: for a fraction of sec. but then again it changes to the default DIR automatically.
but when try "cd d:\program files" or "cd d:\windows" it works fine.
dont know whats happening.....please help guys

If you want to go back one directory .. issue the following command:

C:\Documents and Settings\user>cd ..
C:\Documents and Settings>cd ..
C:\>

The thread is already marked as solved but I don't think it has been solved yet ??

This thread has not been solved. What the original poster was trying to do (and what I am trying to do while searching for the same solution) is switch actual drives from the MS-DOS line. Using commands such as:

cd ..
dir

only give us control and viewing of the same drive. We want to go from C:\Program Files\ to D:\other stuff or E:\another drive folder\, not just from C:\Program Files to C:\ or C:\Program Files\World of Warcraft\.

If you wish to change the drive alone to end up in its root, then type
E:
If you wish to change the drive AND specify a directory or file at the same time then type
cd /D E:\"other stuff"
Then when inside the directory "other stuff" you can open a file this_one.fil by typing
this_one.fil
See the D switch? Use the "" when there is a space in the pathname. It could also be this...
cd /D "E:\other stuff"
And I doubt you are using MS-DOS in XP?... it is likely the command line in cmd.exe.
cd .. takes you to the parent of the directory you are in, and is a one-way street ending at the root, with no branching possible.
Also type cd /?

to change drive you use sytax "drive letter :"
example "c:\anydir\> d:" move cursor from c:\anydir\ to d:\

This will solve your problem:

cd /d <DriveLetter>

Example:
cd /d E:

try it.... ;)

ok here is an easy walk through how to change from one directory to an another where the directory is on another drive.

Q: Say you start at c:\windows and need to get too F:\my directory

1: At the cmd prompt type in f: this will change the drive letter to F:\

2: you may not be at the root so may have type cd .. to get back the branch in this case it would be the root of F drive. once there type in cd my directory

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.