Dos paths use old 8.3 file names, so if any path contains a space, you
will have to find out the 8.3 version or enclose the whole path in
double quotes. 8.3 file names and paths can be found by using
dir /x in
command prompt, e.g.:
cmd.exe cd \ dir /x Volume in drive C is Home Volume Serial Number is BC55-A8B4 Directory of C:\ 27/12/2005 01:19 0 AUTOEXEC.BAT 27/12/2005 01:19 0 CONFIG.SYS 24/07/2007 19:21 DOWNLO~1 Downloads 2 File(s) 0 bytes 1 Dir(s) 12,983,218,176 bytes free
Because Windows was the active directory, no other commands are needed.
But if you knew you wanted to move to a subdirectory of a directory
immediately you use a back slash (
\). So the command would be: cd
Parent Directory\Subdirectory e.g.
This is called moving into a “deep” directory. If however, you were
already in a deep directory and wanted to move directly to a folder that
is nearer to the root, you can include an initial back slash (
tells the CD command to move to the root of the drive first.
So far, we’ve looked at moving forward in the folder (directory) tree.
You can also move backwards, or “Up”, in exactly the same way as “Up One
Level” we’re familiar with in the Windows GUI environment. Typing two
..) move’s up one level. This is used in the same way as Relative
URLs in HTML. Typing one dot (
.) refers to the current directory You can
return to the root of the drive by typing a back slash (
paths can be used with the CD command as before and can be strung
together like usual, e.g.
Relative paths are a useful way of saving time when navigating between folders, but are good to implement in folders that can have changing paths. For example, if a person installs a game, they can install the game to a different directory than default. If a configuration file is nested within the games folders and the games folder tree remains intact, relative paths can be used in the config’s to point, for example, to an exe that is in the games root folder, i.e.
Normally, whenever you run a batch file, if a program is called to launch in the batch, the command prompt will stay running and doesn’t close until the program has closed. Adding an EXIT command to the end of the batch file is suppose to end it, but “it is important to realize that if a batch file or program is still running a program, the MS-DOS windows will not close until it has completed. Therefore a MS-DOS window may remain open either because the program stopped responding or because it’s still performing tasks.” One way of closing the command window before the program has closed is to call the program with the START command, e.g.