introduction to ms dos
TRANSCRIPT
![Page 1: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/1.jpg)
Basic MS-DOS
![Page 2: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/2.jpg)
History
MS-DOS 1.0 was released in August 1981, and was updated until April 1994 when it was replaced by Windows 95
All versions of windows still contain some type of DOS, in windows 95 and 98 you can go to run and type command to get to DOS prompt, in NT, 2000, and XP you can type CMD and get DOS.
![Page 3: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/3.jpg)
The role of DOS is to interpret commands that the user enters via the keyboard.
These commands allow the following tasks to be executed:
file and folder management disk upgrades hardware configuration memory optimization program execution
Introduction
![Page 4: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/4.jpg)
File Manipulation
DIR - Lists files and subdirectories• Wildcard Characters ? *
EDIT - creates a new file or modifies an existing fileCOPY - copies a file or a group of filesXCOPY - copies all files in a directory (and its subdirectories)DEL or ERASE - deletes a file or a group of filesUNDELETE - undeletes filesCOPY (or XCOPY) plus DEL - moves filesDOSKEY - recalls commandsRENAME or REN - renames filesTYPE - displays text filesPRINT - prints a text fileCOPY - used to create a fileATTRIB - sets file propertiesFC - compares two files
![Page 5: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/5.jpg)
Directory Manipulation
MD or MKDIR - creates a directory
CD or CHDIR - changes directory
PROMPT - changes the command prompt
TREE - displays the directory structure
RD or RMDIR - removes a directory
REN - Renaming directories
PATH - creates a search path
![Page 6: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/6.jpg)
Basic Structure
Most DOS commands use the same structure
Command Source Destination /Switch
The switch will give options to the command
Example COPY A:\file.txt c:\ /v
/v will verify if the file copied correctly
![Page 7: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/7.jpg)
The Help Switch /?
You can use the help switch with any command. It will give you the command structure, and the availible switches.
![Page 8: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/8.jpg)
MS-DOS Prompt
The prompt in MS-DOS displays your current directory
C:\dos\commands> means you are in that directory, and any command you use will apply to the current directory unless you specify a different one.
![Page 9: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/9.jpg)
DOS Naming
Characters like * + = | \ [ ] : ; “ < > , ? / cannot be used in DOS names.
![Page 10: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/10.jpg)
Alternatively referred to as the file path and full path, the absolute path contains the root directory and all other subdirectories that contain a file or folder.
absolute pathC:\Windows\calc.exe
Windows non absolute path (relative path)calc.exe
Relative and Absolute path
![Page 11: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/11.jpg)
Wildcard characters
Wildcard character will replace a single letter, or word with a wild character
* will replace any amput of characters, and ? Will replace one.
Example: copy a:/*.txt c:/ will copy all text files to drive c:/
Example 2: copy a:/?????.txt c:/ will copy any 5 letter text file to c:/
![Page 12: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/12.jpg)
Basic Commands CD
CD- Change directory
You use this command when you want to change the directory.
Example: CD C:\DOS will bring you to the dos folder
![Page 13: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/13.jpg)
Basic Commands CD.. And CD\
CD.. - brings you to the previous directory.
Example: if you are in C:\DOS\FOLDER
CD.. Will bring you to C:\DOS
![Page 14: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/14.jpg)
Basic Commands CLS
CLS Will clear the contents of the screen
![Page 15: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/15.jpg)
Basic Commands DIR
DIR will display the contents of the folder
![Page 16: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/16.jpg)
Basic Commands COPY
COPY will copy the file from one location to another
Example COPY A:\file.txt c:\ will copy the file from a:\ to c:\
![Page 17: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/17.jpg)
Basic Command XCOPY
XCOPY can move files, directories, and whole drives from one location to another, It is more powerful then the copy command, and has a lot of switches.
![Page 18: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/18.jpg)
Basic Commands MOVE
MOVE will move the file or directory from one location to another
Example: MOVE a:\file.txt c:\file.txt will move the file to the c:\ drive
![Page 19: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/19.jpg)
Basic Command DEL
DEL will delete a file or an empty directory from the drive
![Page 20: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/20.jpg)
Basic Command EDIT
EDIT will open a text file
![Page 21: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/21.jpg)
Basic Commands REN
REN will rename the file
Example : REN file.txt myfile.txt will rename the file.txt to myfile.txt
![Page 22: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/22.jpg)
Basic Commands MD/RD
MD is used to make a directory (folder) in MS-DOS.
Example: MD myfolder will make a folder called myfolder in current directory
RD is used for remove directory
![Page 23: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/23.jpg)
Deleting folders and sub folders
![Page 24: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/24.jpg)
Basic Command TREE
TREE shows you all of the folders and files in current directory like explorer in windows.
![Page 25: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/25.jpg)
Attributes
Attributes are the properties of a file such as hidden, read-only, archive or system file.
In MS-DOS you can view/change attributes with the attrib command.
Example: attrib +r file.txt will make the file read-only.
![Page 26: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/26.jpg)
The MORE Command
![Page 27: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/27.jpg)
The PRINT Command
The PRINT Command in MS DOS is used to print the text files
Syntax : PRINT Filename
E.g. PRINT File1.txt
![Page 28: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/28.jpg)
The PROMPT Command
The PROMPT is used to configure a DOS prompt into our linking
Syntax : C:\ PROMPT Promptname
E.g. PROMPT NCIT
Now, the Prompt will be as NCIT
![Page 29: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/29.jpg)
Checking the Date/Time
For checking the date from the system in MS DOS, we use the DATE command. It returns the current system date.
Similarly, the TIME command returns the current time from the system.
Syntax : C:\>DATE
E.g. C:\>DATE
![Page 30: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/30.jpg)
command line.Go to Run –> cmd. This should open the command prompt.
Type g:\ where g is the USB drive letter.
Now run the following command: attrib -h -r -s -a *.*. This will remove the attributes hidden, archive, system from all the files.
Type del autorun.inf. This will delete the autorun.inf file.
Removing unwanted Files
![Page 31: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/31.jpg)
![Page 32: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/32.jpg)
F:\>edit test.txt
F:\>edit test.txt
F:\>copy con 123.docxmy name is indika rathninda^Z 1 file(s) copied.
F:\>edit 123.docx
F:\>dir>1234.txt
![Page 33: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/33.jpg)
![Page 34: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/34.jpg)
![Page 35: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/35.jpg)
![Page 36: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/36.jpg)
Batch file
DOS, OS/2, and Windows, a batch file is a
type of script file, a text file containing a
series of commands to be executed by the
command line interpreter. A batch file may
contain any command the interpreter accepts
interactively at the command prompt.
![Page 37: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/37.jpg)
The Old New Thing
The command processor CMD.EXE comes with a mini-calculator that can perform simple arithmetic on 32-bit signed integers:
C:\>set /a 2+2 4 C:\>set /a 2*(9/2) 8 C:\>set /a (2*9)/2 9 C:\>set /a "31>>2" 7 Note that we had to quote the shift operator since it would otherwise be misinterpreted as a "redirect stdout and append" operator.
For more information, type set /? at the command prompt.
![Page 38: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/38.jpg)
Concatenating Files Together in MS-DOS
Say you have two files (or twenty) named textfile1.txt and textfile2.txt. You want to create a new text file that combines the two.
While you could open each file up in your favorite editor and copy and paste the text, this is time consuming and error prone. A much easier way to accomplish this task is to use the copy command: >copy *.txt result.txt
This will take all the files with the extension .txt and create a new text file called result.txt out of all of them.
![Page 39: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/39.jpg)
Finding Text Inside Files in MS-DOS
Lets assume I have a group of text files and I need to find out quickly which one contains the string "Test" inside it. You can quickly accomplish this using the 'find' command like so: >find "Test" *.txt This will search the contents of all the text files in the current directory and return a list of all of them that contain the string "Test". This command is extremely useful for searching text files.
![Page 40: Introduction to ms dos](https://reader034.vdocuments.us/reader034/viewer/2022042502/55a636a91a28abd0028b4696/html5/thumbnails/40.jpg)