|
Current Directory (or Drive) |
The "current directory" is the folder for which files without a path refer to. For example I could type the following commands::
#1: TYPE "C:\TMP\SomeFile.txt" #2: TYPE "SomeFile.txt"
In command #1 I am telling the "TYPE" command exactly what file I want listed (typed). In command #2 I did not specify the path to the file so it will look at the current directory.
Quite often the name of the current directory will appear in the command "prompt" as shown below (before the "ECHO" command):
C:\TMP> ECHO The Current dir is "%CD%" The Current dir is "C:\TMP"
The "CD" environment variable is used above to display the location of the current directory.
Note that there is a "current directory" for each drive letter and so there is also the concept of a current drive, the following shows changing the current drive as well as typing the contents of the file ("C:\TMP\SomeFile.txt"):
C:\TMP> D: D:\ > CD \FolderOnD" D:\FolderOnD > TYPE "C:SomeFile.txt"
Both "C:SomeFile.txt" and "SomeFile.txt" are relative filenames as they depend on what the current directory or drive is and "C:\TMP\SomeFile.txt" is called an absolute filename as the name of the file is fully qualified.
![]() ![]() |
| ![]() ![]() |