commands

Saturday, May 8, 2010




A: - Change current directory path to the floppy disk drive
C: - Change current directory path to the hard disk drive
DIR - Display current directory (show all files and sub-directories).
MD - Make a new directory, eg: MD C:\EMAIL
CD - Change current directory, eg. CD C:\EMAIL
COPY - Copy file(s) from one place to another.
Del - Delete/erase a file

cd commands CD (Change Directory) is a command used to switch directories in MS-DOS.

cd\[enter]

Goes to the highest level, the root of the drive.

cd.. [enter]
goes back one directory

dir Lists all files and directories in the directory that you are currently in.

dir *.exe [enter]
The above command lists any executable file or any file that ends with .exe. See our wildcard definition for other wildcard (e.g. *) examples.

dir /ad [enter]
List only the directories in the current directory. If you need to move into one of the directories listed use the cd command.

dir /s [enter]
Lists the files in the directory that you are in and all sub directories after that directory, if you are at root "C:\>" and type this command this will list to you every file and directory on the C: drive of the computer.

dir /p [enter]
If the directory has a lot of files and you cannot read all the files as they scroll by, you can use this command and it will display all files one page at a time.

dir /w [enter]
If you don't need the info on the date / time and other information on the files, you can use this command to list just the files and directories going horizontally, taking as little as space needed.

dir /s /w /p [enter]
This would list all the files and directories in the current directory and the sub directories after that, in wide format and one page at a time.

dir /on [enter]
List the files in alphabetical order by the names of the files.

dir /o-n[enter]
List the files in reverse alphabetical order by the names of the files.

dir \ /s |find "i" |more[enter]
A nice command to list all directories on the hard drive, one screen page at a time, and see the number of files in each directory and the amount of space each occupies.

copy *.* a:[ enter]
Copy all files in the current directory to the floppy disk drive.

copy con test.txt [enter]
Finally, a user can create a file using the copy con command as shown above, which creates the test.txt file. Once the above command has been typed in, a user could type in whatever he or she wishes. When you have completed creating the file, you can save and exit the file by pressing CTRL+Z, which would create ^Z, and then press enter. An easier way to view and edit files in MS-DOS would be to use the edit command.

del test.tmp = Deletes the test.tmp in the directory that you currently are in, if the file exists.
del c:\windows\test.tmp = Delete the c:\windows\test.tmp in the windows directory if it exists.
del c:\windows\temp\*.* = (* is for wild character(s)) *.* indicates that you would like to delete all files in the c:\windows\temp directory.
del c:\windows\temp\?est.tmp = (? is a single wild character for one letter) This command would delete any file ending with est.tmp such as pest.tmp or zest.tmp

(Notice: Users who are running Microsoft Windows 95 and are used to deleted items going to the recycle bin need to keep in mind that deleting files from MS-DOS does not send files to the recycle bin.)

0 comments:

Post a Comment