Occasionally,
on your Windows computer, you may need to perform a procedure by
typing in commands at the 'Command Prompt'. Entering commands in this
way allows you to bypass the Windows graphical user interface and
communicate directly with the operating system. You are most likely
to need to work in this way if you get an infection and have to
disinfect your computer from the command line, for example, using
SAV32CLI.
To
communicate through the Windows command line, you will need to use
MS-DOS commands. This article lists some basic DOS commands that you
are likely to find useful when working from the command line, but
there are many more available. To find out more about MS-DOS, consult
a book, online dictionary or encyclopedia, or other specialist
publication.
Occasionally,
on your Windows computer, you may need to perform a procedure by
typing in commands at the 'Command Prompt'. Entering commands in this
way allows you to bypass the Windows graphical user interface and
communicate directly with the operating system. You are most likely
to need to work in this way if you get an infection and have to
disinfect your computer from the command line, for example, using
SAV32CLI.
To
communicate through the Windows command line, you will need to use
MS-DOS commands. This article lists some basic DOS commands that you
are likely to find useful when working from the command line, but
there are many more available. To find out more about MS-DOS, consult
a book, online dictionary or encyclopedia, or other specialist
publication.
Command and Usage Example
ATTRIB
Change file attributes. '+' adds an attribute, '-' removes it. Attributes are: A=archive; R=read only; S=system; H=hidden. ATTRIB -R -A -S -H <VIRUS.EXE>
All these attributes will be removed from virus.exe.
C:
Go to the C: drive. Similarly A: and D: etc. C:
CD
Change directory. When you change directory, the prompt changes, showing the path of the directory you are currently in.
Note, directory is the term used by DOS for what Windows calls a folder. CD\ takes you to the top of the directory tree (typically to C:) .
CD.. moves you one level up the directory tree (i.e. up towards the root directory).
CD <DIRECTORYNAME> takes you to that directory. You can use one or more subdirectory names, separated by \ e.g.
CD WINNT\Media takes you to the directory C:\WINNT\Media
To change to another path, type the full path with slashes. e.g.
CD \WINDOWS\SYSTEM
CLS
Clear the screen. CLS
DEL
Delete one or more files in the current directory. Can be used with the '*' and the '?' wildcards.
DEL *.* will delete ALL files in the current directory, USE WITH CAUTION.
(Note: DEL cannot be used to delete directories. Use RD to remove a directory.) DEL <VIRUS.EXE> deletes virus.exe
DEL *.JPG will delete all files with the extension JPG.
DEL MY*.* will delete all files beginning with MY and with any extension.
DEL MY??.* will delete files that are 4 characters long and begin with MY and with any extension.
DIR
Displays the contents of a directory (folder).
Note, directory is the term used by DOS for what Windows calls a folder.
These switches can be combined, so DIR /W /P will return multiple rows listing a page at a time.
You can use the '*' and the '?' wildcards to search for a particular file. The ? character represents ONE character, and the * character represents multiple characters.
DIR *.* lists all the files in a directory. DIR displays all files and folders in the current directory. Folders are indicated in the list by <DIR>.
Files are usually listed by name.
DIR /P displays the contents a page at a time, i.e. as many as will fit in your command line window. Press any key to display the next page.
DIR /W displays the files/folders in multiple rows. This view gives less information per file.
DIR *.JPG displays all files with the extension JPG in the current directory and all subdirectories.
DIR MY??.* displays all files beginning with MY, exactly 4 characters long, and with any extension.
DIR /S lists the contents of all subdirectories.
DIR /AH displays all hidden files.
EDIT
Runs DOS EDIT (a simple text editor). Useful for editing batch files and viewing logs. This command requires QBASIC.EXE to be present. EDIT <VIRUSLOG.TXT> opens the file viruslog.txt and allows you to edit it.
EDIT <NEWFILE.TXT> creates a new file called newfile.txt and opens it up for you to edit.
HELP
Displays DOS Help. For help on an individual command, type HELP then the command for which you want more information. HELP DIR displays information on the DIR command.
MD
Make directory. Creates a new directory below the current one. (The command can also be written as MKDIR) MD <NEWDIR> creates a new directory called Newdir.
PRINT
Prints the specified file (if the printer is supported in DOS - many are not). PRINT <LOGFILE.TXT>
Prints LOGFILE.TXT
RD
Remove directory. Removes a subdirectory of the current directory. The directory you want to remove must be empty of all files. (The command can also be written as RMDIR) RD <DIRECTORYNAME>
RENAME
Rename a file. You must use the full file name including the suffix. RENAME <OLDNAME.EXE> <NEWNAME.EXE>
TYPE
Displays the contents of a file on the screen. If you use this command on a file which is not a text file, the display will be unintelligible. Use with "|MORE" to display the text on a page by page basis, and prevent it scrolling off the screen. "|" is a pipe character. TYPE C:\README.TXT|MORE
>
When you run a DOS command, output is usually sent to the screen. Use > to redirect output from the screen to a file. It runs the command preceding the >, creates a file in the current directory with the name you specify, and sends the information/output returned by the command, to that file. COMMAND > FILENAME.TXT
e.g. SWEEP > REPORT.TXT The details of any infected files reported by SWEEP are sent to a file called REPORT.TXT.
| Command and Usage | Example |
| ATTRIB Change file attributes. '+' adds an attribute, '-' removes it. Attributes are: A=archive; R=read only; S=system; H=hidden. | ATTRIB -R -A -S -H <VIRUS.EXE> All these attributes will be removed from virus.exe. |
| C: Go to the C: drive. Similarly A: and D: etc. | C: |
| CD Change directory. When you change directory, the prompt changes, showing the path of the directory you are currently in. Note, directory is the term used by DOS for what Windows calls a folder. | CD\ takes you to the top of the directory tree (typically to C:) . CD.. moves you one level up the directory tree (i.e. up towards the root directory). CD <DIRECTORYNAME> takes you to that directory. You can use one or more subdirectory names, separated by \ e.g. CD WINNT\Media takes you to the directory C:\WINNT\Media To change to another path, type the full path with slashes. e.g. CD \WINDOWS\SYSTEM |
| CLS Clear the screen. | CLS |
| DEL Delete one or more files in the current directory. Can be used with the '*' and the '?' wildcards. DEL *.* will delete ALL files in the current directory, USE WITH CAUTION. (Note: DEL cannot be used to delete directories. Use RD to remove a directory.) | DEL <VIRUS.EXE> deletes virus.exe DEL *.JPG will delete all files with the extension JPG. DEL MY*.* will delete all files beginning with MY and with any extension. DEL MY??.* will delete files that are 4 characters long and begin with MY and with any extension. |
| DIR Displays the contents of a directory (folder). Note, directory is the term used by DOS for what Windows calls a folder. These switches can be combined, so DIR /W /P will return multiple rows listing a page at a time. You can use the '*' and the '?' wildcards to search for a particular file. The ? character represents ONE character, and the * character represents multiple characters. DIR *.* lists all the files in a directory. | DIR displays all files and folders in the current directory. Folders are indicated in the list by <DIR>. Files are usually listed by name. DIR /P displays the contents a page at a time, i.e. as many as will fit in your command line window. Press any key to display the next page. DIR /W displays the files/folders in multiple rows. This view gives less information per file. DIR *.JPG displays all files with the extension JPG in the current directory and all subdirectories. DIR MY??.* displays all files beginning with MY, exactly 4 characters long, and with any extension. DIR /S lists the contents of all subdirectories. DIR /AH displays all hidden files. |
| EDIT Runs DOS EDIT (a simple text editor). Useful for editing batch files and viewing logs. This command requires QBASIC.EXE to be present. | EDIT <VIRUSLOG.TXT> opens the file viruslog.txt and allows you to edit it. EDIT <NEWFILE.TXT> creates a new file called newfile.txt and opens it up for you to edit. |
| HELP Displays DOS Help. For help on an individual command, type HELP then the command for which you want more information. | HELP DIR displays information on the DIR command. |
| MD Make directory. Creates a new directory below the current one. (The command can also be written as MKDIR) | MD <NEWDIR> creates a new directory called Newdir. |
| PRINT Prints the specified file (if the printer is supported in DOS - many are not). | PRINT <LOGFILE.TXT> Prints LOGFILE.TXT |
| RD Remove directory. Removes a subdirectory of the current directory. The directory you want to remove must be empty of all files. (The command can also be written as RMDIR) | RD <DIRECTORYNAME> |
| RENAME Rename a file. You must use the full file name including the suffix. | RENAME <OLDNAME.EXE> <NEWNAME.EXE> |
| TYPE Displays the contents of a file on the screen. If you use this command on a file which is not a text file, the display will be unintelligible. Use with "|MORE" to display the text on a page by page basis, and prevent it scrolling off the screen. "|" is a pipe character. | TYPE C:\README.TXT|MORE |
| > When you run a DOS command, output is usually sent to the screen. Use > to redirect output from the screen to a file. It runs the command preceding the >, creates a file in the current directory with the name you specify, and sends the information/output returned by the command, to that file. | COMMAND > FILENAME.TXT e.g. SWEEP > REPORT.TXT The details of any infected files reported by SWEEP are sent to a file called REPORT.TXT. |
You can also watch this Video :)
You can also watch this Video :)
Is Command Prompt considered as MS DOS because it says that we need to use MS DOS commands?
TumugonBurahinCommand Prompt is sometimes incorrectly referred to as "the DOS prompt" or as MS-DOS itself. Command Prompt is a Windows program that emulates many of the command line abilities available in MS-DOS but it is not actually MS-DOS.
BurahinFrom what i know Ms-dos is only available for older version of windows 32-bit(x86), what is more convenient to use MS-DOS or CMD ? i think you can use some ms-dos commands to cmd ?
TumugonBurahinMS-DOS dominated the IBM PC compatible market between 1981 and 1995, or until about 2001 including the partially MS-DOS-based Microsoft Windows (95, 98, and Millennium Edition). So nowadays, Command Prompt is more convenient to use. And you can use ALL MS-DOS Commands to Command Prompt.
BurahinCan i use this basic DOS commands in command prompt?
TumugonBurahinOf course, to perform a procedure in 'Command Prompt'we need to use MS-DOS commands. because DOS commands are used to communicate and operated by the Windows command line.
BurahinCan I install a software program through a MS-DOS command line?
TumugonBurahinYou can install a software program through a Microsoft DOS and command prompt, but MS-DOS command line is referred only to as the command screen or a text interface, the command line or Windows command line is a user interface that is navigated by typing commands at prompts, instead of using the mouse.
BurahinI just want to know, is there any way to erase all virus in the computer system using MS DOS COMMANDS?
TumugonBurahinYes, If the virus is running in your computer find the virus name first.
BurahinIf you found it
type in the command line
taskkill /IM virusname.exe /F the IM and F should be capitalize.
This command will kill or stop the virus from running in your computer.
The next thing you do is to delete all virus but first you must find the path where the virus is located.
If you found it go to the virus path using cd command. For example the virus is in system32
you must type this "cd windows\system32"
then the prompt will be in system32 and it will look like this c:\windows\system32>_
then type attrib -r -h -s virusname.exe
this command will make the virus visible.
so type then erase or del virusname.exe
Thats it...
Just wanna ask, was MS DOS really helpful? I mean, I don't know about this operating system. I just watched some movies featuring the MS DOS. How can you persuade others to use this operating system instead of using the new and advanced operating system now a days? Please elaborate the advantages of using the MS DOS.
TumugonBurahinIt is helpful before, but Today, MS-DOS is no longer used; however, the command shell, more commonly known as the Windows command line is still used by many users. MS-DOS window more appropriately referred to as the Windows command line looks like running under Microsoft Windows. This blog was not saying that this commands are for MS DOS ONLY. It also want to say that DOS commands are also can use to COMMAND PROMPT.
BurahinI am aware that MS DOS can be used to detect information (IP config) or more seriously to hack a personal computer. What should I do to secure my PC ? Please advice some helpful tips to do so.
TumugonBurahinAll you have to do is to create a password for your security.
BurahinMa'am I just want to ask if it possible to make an application or just simple software using MS-DOS Commands? My friend(comsci student) told me about batching and I literally don't know what it is and how do it works? and if it is possible for us to encounter it in our course ? ma'am can you give us a brief information if it is possible :D
TumugonBurahinNow I know Dos Commands are very use full especially on accessing files, configuration and more, but I hope I can learn more about some of the Dos commands.
TumugonBurahin:) you can explore some DOS commands aside from what are posted to my blog.
Burahinis ms dos commands spelling sensitive ? and space sensitive ?
TumugonBurahinYes, you have to type the right command to make the MS DOS or Command prompt work.
BurahinCan you create games/application using MS DOS?
TumugonBurahinYou can use DOSBOX to run DOS GAMES.
BurahinWhat version/s of Windows does the MS-DOS supports? What are some other examples of DOS?
TumugonBurahinMicrosoft Windows (95, 98, and Millennium Edition)
BurahinIt was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s and the early 1990s, when it was gradually superseded by operating systems offering a graphical user interface (GUI), in various generations of the graphical Microsoft Windows operating system by Microsoft Corporation and what do you mean in 'Examples of DOS'? Is this DOS commands?
How do I stop a process that is running? How to I kill a process?
TumugonBurahinI think taskkill is what you're looking for. With it you can kill a running process by its ID or image name (name of the .exe file).
BurahinCan I stop another application from running using these commands?
TumugonBurahinYes, use the Taskkill command
BurahinIs there any special application for the ms dos instead of using it just like the mouse?
TumugonBurahinPlease elaborate your question? Windows command line is navigated by typing commands at prompts, instead of using the mouse.
Burahinwhat is the difference in dos and html? or is their any difference between the two?
TumugonBurahinThere is a big differences, you cant create your own website while with HTML you can create your own Web site
Burahinmaam.. san po namin ito magagamit?? applicable po ba ito sa OS ng MAC?
TumugonBurahinIt can help you resolve issues with a crashed drive or format and run old DOS apps that will never run with newer versions of DOS or Windows.Yes
Burahinmaam.. how can i use this kind of commands? if i don't have a background in this kind of things.. i dont even understand those codes? is it really that important ??
TumugonBurahinTry to study this codes and explore. yes it is very important how can you do things if you are pushing yourself to know/learn those things?
BurahinHi maam! Im not familiar with MS DOS, but i just want to ask what are the other uses or functions of MS DOS?
TumugonBurahinHello Rhencee :) MS-DOS allows the user to navigate, open, and otherwise manipulate files on their computer from a command line instead of a GUI like Windows.
BurahinNow i know that All MS DOS Commands are useful because it can also be used in Command Prompts. Thats why Command Prompts are more convenient to use.
TumugonBurahinGood day Ma'am thanks for that info. :)
Your welcome Cathy :) Good for you :)
Burahin