Labels

Microsoft DOS and command prompt 01



All MS-DOS commands


About MS-DOS
Short for Microsoft Disk operating system, MS-DOS is a non-graphical command line operating system created for IBM compatible computers that was first introduced by Microsoft in August 1981 and was last updated in 1994 when MS-DOS 6.22 was released. Although the MS-DOS operating system is not commonly used today, the command shell more commonly known as the Windows command line is still used and recommended.


ansi.sys | append | arp | assign | assoc | at | atmadm | attrib


About ansi.sys

Defines functions that change display graphics, control cursor movement and reassign keys. The ANSI.SYS device driver supports ANSI terminal emulation of escape sequences to control your system's screen and keyboard. An ANSI escape sequence is a sequence of ASCII characters, the first two are the escape character (1Bh) and the left bracket character (5Bh). The character or characters following the escape and left bracket characters specify an alphanumeric code that controls a keyboard or display function. ANSI escape sequences distinguish between uppercase and lowercase letters; for example, "A" and "a" have completely different meanings.

Availability

The ansi.sys command is external file and is available in
MS-DOS 5.0 and above
Windows 95
Windows 98
Windows NT
Windows 2000
Windows XP
How to load
This device driver must be loaded by a device or devicehigh command in your CONFIG.SYS file.
To load this file within Windows 95/98 the config.sys must have:
device=c:\windows\command\ansi.sys
To load this file within Windows 3.x or Windows NT use the below line.
device=c:\dos\ansi.sys

Syntax

Syntax:
Device=[drive:][path]ANSI.SYS [/x] [/k] [/r]

Parameters:
[drive:][path] Specifies the location of the Ansi.sys file. Additional [drive:][path] specifies the location of the Ansi.sys file. Additional information on where to load these files can be found in the how to load section.

Switches
/x Remaps extended keys independently on 101-key keyboards.
/k Causes ANSI.SYS to treat a 101-key keyboard like an 84-key keyboard. This is equivalent to the command SWITCHES=/k. If you usually use the SWITCHES=/k command, you will need to use the /k switch with ANSI.SYS.
/r Adjusts line scrolling to improve readability when ANSI.SYS is used with screen-reading programs (which makes computers more accessible to people with disabilities).
Parameters
Pn Numeric parameter. Specifies a decimal number.
Ps Selective parameter. Specifies a decimal number that you use to select a function. You can specify more than one function by separating the parameters with semicolons.
PL Line parameter. Specifies a decimal number that represents one of the lines on your display or on another device.
Pc Column parameter. Specifies a decimal number that represents one of the columns on your screen or on another device.
Escape sequences
ANSI escape sequences for cursor movement, graphics, and keyboard settings:
In the below list of ANSI escape sequences, the abbreviation ESC represents the ASCII escape character 27 (1Bh), which appears at the beginning of each escape sequence.

ESC[PL;PcH Cursor Position: Moves the cursor to the specified position (coordinates). If you do not specify a position, the cursor moves to the home position — the upper-left corner of the screen (line 0, column 0). This escape sequence works the same way as the below Cursor Position escape sequence.
ESC[PL;Pcf Cursor Position: Works the same way as the preceding Cursor Position escape sequence.
ESC[PnA Cursor Up: Moves the cursor up by the specified number of lines without changing columns. If the cursor is already on the top line, ANSI.SYS ignores this sequence.
ESC[PnB Cursor Down: Moves the cursor down by the specified number of lines without changing columns. If the cursor is already on the bottom line, ANSI.SYS ignores this sequence.
ESC[PnC Cursor Forward: Moves the cursor forward by the specified number of columns without changing lines. If the cursor is already in the rightmost column, ANSI.SYS ignores this sequence.
ESC[PnD Cursor Backward: Moves the cursor back by the specified number of columns without changing lines. If the cursor is already in the leftmost column, ANSI.SYS ignores this sequence.
ESC[s Save Cursor Position: Saves the current cursor position. You can move the cursor to the saved cursor position by using the Restore Cursor Position sequence.
ESC[u Restore Cursor Position: Returns the cursor to the position stored by the Save Cursor Position sequence.
ESC[2J Erase Display: Clears the screen and moves the cursor to the home position (line 0, column 0).
ESC[K Erase Line: Clears all characters from the cursor position to the end of the line (including the character at the cursor position).
ESC[Ps;...;Psm Set Graphics Mode: Calls the graphics functions specified by the below values. These specified functions remain active until the next occurrence of this escape sequence. Graphics mode changes the colors and attributes of text (such as bold and underline) displayed on the screen.
Text attributes
0 All attributes off
1 Bold on
4 Underscore (on monochrome display adapter only)
5 Blink on
7 Reverse video on
8 Concealed on

Foreground colors
30 Black
31 Red
32 Green
33 Yellow
34 Blue
35 Magenta
36 Cyan
37 White

Background colors
40 Black
41 Red
42 Green
43 Yellow
44 Blue
45 Magenta
46 Cyan
47 White

Parameters 30 through 47 meet the ISO 6429 standard.
ESC[=Psh

Set Mode: Changes the screen width or type to the mode specified by one of the below values:
0 40 x 148 x 25 monochrome (text)
1 40 x 148 x 25 color (text)
2 80 x 148 x 25 monochrome (text)
3 80 x 148 x 25 color (text)
4 320 x 148 x 200 4-color (graphics)
5 320 x 148 x 200 monochrome (graphics)
6 640 x 148 x 200 monochrome (graphics)
7 Enables line wrapping
13 320 x 148 x 200 color (graphics)
14 640 x 148 x 200 color (16-color graphics)
15 640 x 148 x 350 monochrome (2-color graphics)
16 640 x 148 x 350 color (16-color graphics)
17 640 x 148 x 480 monochrome (2-color graphics)
18 640 x 148 x 480 color (16-color graphics)
19 320 x 148 x 200 color (256-color graphics)

Reset Mode: Resets the mode by using the same values that Set Mode uses, except for 7, which disables line wrapping. The last character in this escape sequence is a lowercase L.
ESC[code;string;...p
Set Keyboard Strings: Redefines a keyboard key to a specified string. The parameters for this escape sequence are defined as follows:
  • Code is one or more of the values listed in the below table. These values represent keyboard keys and key combinations. When using these values in a command, you must type the semicolons shown in this table in addition to the semicolons required by the escape sequence. The codes in parentheses are not available on some keyboards. ANSI.SYS will not interpret the codes in parentheses for those keyboards unless you specify the /x switch in the device command for ANSI.SYS.
  • String is either the ASCII code for a single character or a string contained in quotation marks. For example, both 65 and "A" can be used to represent an uppercase A.
Important: Some of the values in the below table are not valid for all computers. Check your computer's documentation for values that are different.

ASCII Key Codes
Key Code ^SHIFT^+code ^CTRL^+code ALT+code
F1 0;59 0;84 0;94 0;104
F2 0;60 0;85 0;95 0;105
F3 0;61 0;86 0;96 0;106
F4 0;62 0;87 0;97 0;107
F5 0;63 0;88 0;98 0;108
F6 0;64 0;89 0;99 0;109
F7 0;65 0;90 0;100 0;110
F8 0;66 0;91 0;101 0;111
F9 0;67 0;92 0;102 0;112
F10 0;68 0;93 0;103 0;113
F11 0;133 0;135 0;137 0;139
F12 0;134 0;136 0;138 0;140
HOME (num keypad) 0;71 55 0;119 -
UP ARROW (num keypad) 0;72 56 (0;141) -
PAGE UP (num keypad) 0;73 57 0;132 -
LEFT ARROW (num keypad) 0;75 52 0;115 -
RIGHT ARROW (num keypad) 0;77 54 0;116 -
END (num keypad) 0;79 49 0;117 -
DOWN ARROW (num keypad) 0;80 50 (0;145) -
PAGE DOWN (num keypad) 0;81 51 0;118 -
INSERT (num keypad) 0;82 48 (0;146) -
DELETE (num keypad) 0;83 46 (0;147) -
HOME (224;71) (224;71) (224;119) (224;151)
UP ARROW (224;72) (224;72) (224;141) (224;152)
PAGE UP (224;73) (224;73) (224;132) (224;153)
LEFT ARROW (224;75) (224;75) (224;115) (224;155)
RIGHT ARROW (224;77) (224;77) (224;116) (224;157)
END (224;79) (224;79) (224;117) (224;159)
DOWN ARROW (224;80) (224;80) (224;145) (224;154)
PAGE DOWN (224;81) (224;81) (224;118) (224;161)
INSERT (224;82) (224;82) (224;146) (224;162)
DELETE (224;83) (224;83) (224;147) (224;163)
PRINT SCREEN - - 0;114 -
PAUSE/BREAK - - 0;0 -
BACKSPACE 8 8 127 (0)
ENTER 13 0 10 (0
TAB 9 0;15 (0;148) (0;165)
NULL 0;3 - - -
A 97 65 1 0;30
B 98 66 2 0;48
C 99 66 3 0;46
D 100 68 5 0;18
E 101 69 5 0;18
F 102 70 6 0;33
G 103 71 7 0;34
H 104 72 8 0;35
I 105 73 9 0;23
J 106 74 10 0;36
K 107 75 11 0;37
L 108 76 12 0;38
M 109 77 13 0;50
N 110 78 14 0;49
O 111 79 15 0;24
P 112 80 16 0;25
Q 113 81 17 0;16
R 114 82 18 0;19
S 115 83 19 0;31
T 116 84 20 0;20
U 117 85 21 0;22
V 118 86 22 0;47
W 119 87 23 0;17
X 120 88 24 0;45
Y 121 89 25 0;21
Z 122 90 26 0;44
1 49 33 - 0;120
2 50 64 0 0;121
3 51 35 - 0;122
4 52 36 - 0;123
5 53 37 - 0;124
6 54 94 30 0;125
7 55 38 - 0;126
8 56 42 - 0;126
9 57 40 - 0;127
0 48 41 - 0;129
- 45 95 31 0;130
= 61 43 - 0;131
] 91 123 27 0;26
[ 93 125 29 0;27
92 124 28 0;43
; 59 58 - 0;39
' 39 34 - 0;40
. 46 60 - 0;51
/ 47 63 - 0;53
` 39 34 - 0;40
ENTER (keypad) 13 - 10 (0;116)
/ (keypad) 47 47 (0;142) (0;74)
* (keypad) 42 (0;144) (0;78) -
- (keypad) 45 45 (0;149) (0;164)
+ (keypad) 43 43 (0;150) (0;55)
5 (keypad) (0;76) 53 (0;143) -



About append

Similar to the PATH MS-DOS command, the append command enables a user to open files in the specified directory as if they were in the current directory.
 Tip: See our append definition if you're looking for information about how to append text or a file into a file.

Availability

Append.exe is an external command available in the below versions of Microsoft operating systems.
MS-DOS 3.2x - 6.2x
Windows 95
Windows 98
Windows ME
Windows NT
Windows 2000
Windows XP

Syntax
APPEND Drive: \Path /X /E Path:on or off

Drive: The drive letter to be searched.
\Path The path to be searched.
/X :on or :off Extends the DOS search path for specified files when executing programs. Processes SEARCH FIRST, FIND FIRST and EXEC functions. The :ON and :OFF are new to version MS-DOS 5.0,
/Path :on or :off If path is already included for a program file, :on tells program to also search in appended directories. Default= :on. Note: The default value of = :on was added in MS-DOS 5.0 and above
/E Causes the appended path to be stored in the DOS environment and searched for there.
 ; Use ";" to separate multiple Drive:\path statements on one line.

Examples

Note: You can not use any paths on the same command line as /X and /E. The :ON and :OFF options are only available in MS-DOS 5.0 and later. Do not append within a Windows environment. The append command can be used on a network. Invalid drive specifications will not be detected until DOS attempts to use the search path to find specified files.
append

Using append alone will display the current search path.
append c:\docs;c:\letters;c:\files
Sets the computer to look for files in the docs, letters and files directory, therefore when typing a command such as "edit myfile.txt" if the file is not present in the current directory the computer would also look for the file in docs, letters and files directory.


About arp

Displays, adds and removes arp information from network devices.

Availability

The arp.exe command is an external command accessed through the C:\Windows or C:\Winnt\System32 directory and is available in the below Microsoft operating systems.
Windows 95
Windows 98
Windows ME
Windows NT
Windows 2000
Windows XP
Windows Vista
Windows 7

Syntax

ARP -s inet_addr eth_adr [if_addr]
ARP -d inet_addr [if_addr]
ARP -a [inet_addr] [-N if_addr]
-a Displays current ARP entries by interrogating the current protocol data. If inet_addr is specified, the IP and Physical addresses for only the specified computer are displayed. If more than one network interface uses ARP, entries for each ARP table are displayed.
-g Same as -a
inet_addr Specifies an Internet address.
-N if addr Displays the ARP entries for the network interface specified by if_addr.
-d Deletes the host specified by inet_addr.
-s Adds the host and associates the Internet address inet_addr with the Physical address eth_addr. The Physical address is given as 6 hexadecimal bytes seperated by hyphens. The entry is permanent.
eth_addr Specifies a physical address
if_addr If present, this specifies the Internet address of the interface whose address translation table should be modified. If not present, the first applicable interface will be used.

Examples
arp -a
Interface 220.0.0.80
Internet Address Physical Address Type
   220.0.0.160 00-50-04-62-F7-23 static

The Physical Address or MAC address as shown above in the format aa-bb-cc-dd-ee-ff is the unique manufacturer identification number. This number should always be an unique address.
arp -s 220.0.0.161 00-50-04-62-F7-23

Above, is an example of how to change the above IP address 220.0.0.160 to 220.0.0.161.
If an IP address has already been assigned to the specific network adapter it is not possible to change that assigned IP address to a new address. In addition, networks italicizing DHCP, BOOTP or RARP will automatically assign the card an IP address, therefore, this command would not be utilized.


About assign

Introduced with MS-DOS 2.0 and has been available up to 6.0 where it was removed because of concern with data issues. Was latter made available on the MS-DOS 6.0, 6.2 and 6.22 supplemental disks. The assign command redirects disk operation on one drive to a different drive.
Any users using Windows 95 or above should not use this command and consider using the SUBST command as a substitute.

Availability

The assign command is an external command file named assign.com and is available in the below Microsoft operating systems.
MS-DOS 2.0 - 6.0, 6.2, 6.22

Syntax

ASSIGN Source = Target /status
ASSIGN Assign with no switches cancels redirected drive assignments and sets them back to their original drives.
Source Letters of source drives
Target Letters of target drives
/status Lists current drive assignments

Examples

assign a: = b:
Assigns the A: drive as the B: drive.
assign a =  b = c
Assigns A as B and B as C.
Additional information
The assign command does not work with format, diskcopy, diskcomp, backup, label, restore, print or subst.

Warning: Do not use a colon after a drive letter in versions prior to 5.0.


About assoc

The assoc command displays the file association for each of the different file extensions on the computer.
Additional information and help with computer file extensions can also be found on our file extensions page.

Availability

The assoc command is an internal command that is available in the below Microsoft operating systems.
Windows 2000
Windows XP
Windows Vista
Windows 7

Syntax

Displays or modifies file extension associations
ASSOC [.ext[=[fileType]]]
.ext Specifies the file extension to associate the file type with
fileType Specifies the file type to associate with the file extension

Type ASSOC without parameters to display the current file associations.
If ASSOC is invoked with just a file extension, it displays the current file association for that file extension. Specify nothing for the file type and the command will delete the association for the file extension.

Examples
assoc

Displays a file association of each of the file extensions on the computer.
assoc .txt

Displays the file extension for a .txt file as shown below.
.txt=txtfile

About at

Enables users to schedule tasks to be performed at a specified time and date.

Availability

The at.exe command is an external command that is available in the below Microsoft operating systems.
Windows NT
Windows 2000
Windows XP
Windows 7

Syntax

The AT command schedules commands and programs to run on a computer at a specified time and date. The Schedule service must be running to use the AT command.
AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE] [ /EVERY:date[,...] | /NEXT:date[,...]] "command"
\\computername Specifies a remote computer. Commands are scheduled on the
local computer if this parameter is omitted.
id Is an identification number assigned to a scheduled command.
/delete Cancels a scheduled command. If id is omitted, all the scheduled commands on the computer are canceled.
/yes Used with cancel all jobs command when no further confirmation is desired.
time Specifies the time when command is to run.
/interactive Allows the job to interact with the desktop of the user who is logged on at the time the job runs.
/every:date[,...] Runs the command on each specified day(s) of the week or month. If date is omitted, the current day of the month is assumed.
/next:date[,...] Runs the specified command on the next occurrence of the day (for example, next Thursday). If date is omitted, the current day of the month is assumed.
"command" Is the Windows NT command, or batch program to be run.

Examples

at 6:50PM "c:\winnt\task.bat"
Performing this command would run the task.bat file at 6:50PM today unless the task is scheduled after the time specified. Because the /interactive switch is not in the command, this batch file will be executed in the background.
at 6:50PM /interactive c:\winnt\beep.bat
Runs the beep.bat batch file at 6:50PM with the ability for the user to interact with the batch file.
at 1 /delete
Deletes the at ID 1.
at /delete /yes
Delete all AT IDs.
at

Typing at alone will display each of the scheduled tasks, their status, id, scheduled time, and command as shown below. As you can see if an error occurs with the at process, the status will display an Error.
Status ID Day Time Command Line ------------------------------------------------------------------------------- 1 Tomorrow 6:50 AM c:\winnt\task.bat 2 Tomorrow 2:48 PM c:\ch\hope\logit.bat Error 3 Tomorrow 6:50 PM start notepad
at 1

Typing at followed by an ID number will display additional information about the task id as shown below.

Task ID: 5 Status: OK Schedule: Today, Time of day: 6:55 PM Interactive: No Command: c:\winnt\task.bat

About atmadm

Lists connections and addresses seen by Windows ATM call manager.

Availability

The atmadm command is an internal command that is available in the below Microsoft operating systems.
Windows 2000
Windows XP

Syntax

atmadm [options]
where options are one or more of:
-c List all connections
-a List all registered addresses
-s Display Statistics
Examples
atmadm -c

List the ATM connections (if present), the interface, VCI, VPI, and the address.


About attrib

Attrib allows a user to change the properties of a specified file. Using attrib, the user has the capability of changing the file to have any of the below attributes. Note if you're wanting to change the ACL of a file see the CACLS command.
Read-only - allowing the file to be only viewed and not written to.
Archived - allowing Microsoft backup and other backup programs to know what files to backup.
Hidden - making the file invisible to standard users.
System - making the file an important system file.

Availability

The attrib.exe command is an external command that is available in the below Microsoft operating systems.
MS-DOS 3.0 and above
Windows 95
Windows 98
Windows ME
Windows NT
Windows 2000
Windows XP
Windows Vista
Windows 7

Syntax

Microsoft Windows 95, 98, and ME syntax
Displays or changes file attributes.
ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [[drive:][path]filename] [/S]
+ Sets an attribute.
- Clears an attribute.
R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
/S Processes files in all directories in the specified path.

Microsoft Windows 2000 and Windows XP syntax
Displays or changes file attributes.
ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [[drive:] [path] filename] [/S [/D]]
+ Sets an attribute.
- Clears an attribute.
R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
/S Processes files in all directories in the specified path.
/D Process folders as well.

Microsoft Windows 2000 and Windows XP recovery console syntax

Note: The below options are the available options in the Windows recovery console.
Changes attributes on one file or directory.
ATTRIB -R | +R | -S | +S | -H | +H | -C | +C filename
+ Sets an attribute.
- Clears an attribute.
R Read-only file attribute.
S System file attribute.
H Hidden file attribute.
C Compressed file attribute.

Examples

attrib
Typing attrib by itself will display all files in the current directory and each of their attributes. If any file is hidden it will also display those files.
attrib +r autoexec.bat
Add the read-only attribute to the autoexec.bat file so it cannot be modified until the read only attribute is taken off. This is helpful for important system files or any other file that you do not want to have mistakenly edited or changed by another program.
attrib +h config.sys
Add the hidden attribute to the config.sys file causing it to be not be seen by the average user.
attrib -h config.sys
This command will do the opposite of the above command. Instead of hiding the file it will unhide the file if hidden.
  • How can I see hidden files in MS-DOS?
Extended information
DOS directory file attribute bit position and Hex Value with bit positions (7 6 5 4 3 2 1 0). See the file attributes computer dictionary definition for further information about file attributes.

Bit Positions
Hex Description
0 0 0 0 0 0 0 1 01h Read Only file
0 0 0 0 0 0 1 0 02h Hidden file
0 0 0 0 0 1 0 0 04h System file
0 0 0 0 1 0 0 0 08h Volume Label
0 0 0 1 0 0 0 0 10h Subdirectory
0 0 1 0 0 0 0 0 20h Archive
0 1 0 0 0 0 0 0 40h Reserved
1 0 0 0 0 0 0 0 80h Reserved

Examples
   
0 0 1 0 0 0 0 1 21h Read Only, Archive
0 0 1 1 0 0 1 0 32h Hidden, Subdirectory, Archive
0 0 1 0 0 1 1 1 27h Read Only, Hidden, System file, Archive
0 0 1 0 0 0 1 1 23h Read Only, Hidden, Archive







No comments:

Post a Comment