Friday, April 16, 2010

"cd" Command

CD (Change Directory) is a command used to switch directories in MS-DOS. You can also use CHDIR command instead of CD. This command is available in all versions of MS-DOS and Windows.

Syntax: CD or CHDIR [directoryname]
Example: cd c:\windows or chdir c:\windows.

You can also execute multiple directory path with single command and from any drive. For example, you are present in C drive and if you want to access Data directory under Notes directory under Process directory in D drive then you have to execute the following Command:

C:\> cd d:\process\notes\data and press Enter. You will directly go to -

You can also first change the Drive and then access that particular directory. In this case you need not to include the drive letter.

C:\> d: and then press Enter, you will come to D drive.
D:\> cd process\notes\data and press Enter. Then you will go to -

To go back to the directory, you can either go step by step or you can directly go to the Root Directory. To go one step back, use cd.. Command and to directly go to the Root, use cd\ Command.

D:\process\notes\data> cd..
D:\process\notes> cd..
D:\process> cd ..
D:\process\notes\data> cd\

No comments:

Post a Comment