Saturday 16 November 2013

MS DOS Command Thenkhat



Command
Description
Type
Defines functions that change display graphics, control cursor movement, and reassign keys.
File
Causes MS-DOS to look in other directories when editing a file or running a command.
Displays, adds, and removes arp information from network devices.
Assign a drive letter to an alternate letter.
View the file associations.
Schedule a time to execute commands or programs.
Lists connections and addresses seen by Windows ATM call manager.
Display and change file attributes.
Recovery console command that executes a series of commands in a file.
Recovery console command that allows a user to view, modify, and rebuild the boot.ini
Enable and disable CTRL + C feature.
View and modify file ACL's.
Calls a batch file from another batch file.
Changes directories.
Supplement the International keyboard and character set information.
Changes directories.
Check the hard drive running FAT for errors.
Check the hard drive running NTFS for errors.
Specify a listing of multiple options within a batch file.
Clears the screen.
Opens the command interpreter.
Change the foreground and background color of the MS-DOS window.
Opens the command interpreter.
Compares files.
Compresses and uncompress files.
Open Control Panel icons from the MS-DOS prompt.
Convert FAT to NTFS.
Copy one or more files to an alternate location.
Change the computers input/output devices.
View or change the systems date.
Debug utility to create assembly programs to modify hardware settings.
Re-arrange the hard drive to help with loading programs.
Deletes one or more files.
Recovery console command that deletes a file.
Deletes one or more files or directories.
List the contents of one or more directory.
Recovery console command that disables Windows system services or drivers.
Compare a disk with another disk.
Copy the contents of one disk and place them on another disk.
Command to view and execute commands that have been run in the past.
A GUI to help with early MS-DOS users.
Enables overwrite of original device drivers.
Displays messages and enables and disables echo.
View and edit files.
View and edit files.
Load extended Memory Manager.
Recovery console command to enable a disable service or driver.
Stops the localization of the environment changes enabled by the setlocal command.
Erase files from computer.
Exit from the command interpreter.
Expand a Microsoft Windows file back to it's original format.
Extract files from the Microsoft Windows cabinets.
Displays a listing of MS-DOS commands and information about them.
Compare files.
Utility used to create partitions on the hard drive.
Search for text within a file.
Searches for a string of text within a file.
Writes a new boot sector.
Writes a new boot record to a disk drive.
Boolean used in batch files.
Command to erase and prepare a disk drive.
Command to connect and operate on a FTP server.
Displays or modifies file types used in file extension associations.
Moves a batch file to a specific label or location.
Show extended characters in graphics mode.
Display a listing of commands and brief explanation.
Allows for batch files to perform conditional processing.
32-bit file manager.
Network command to view network adapter settings and assigned values.
Change layout of keyboard.
Change the label of a disk drive.
Load a device driver in to high memory.
Recovery console command that displays the services and drivers.
Load a program above the first 64k.
Load a device driver in to high memory.
Lock the hard drive.
Logoff the currently profile using the computer.
Recovery console command to list installations and enable administrator login.
Displays the device name of a drive.
Command to create a new directory.
Display memory on system.
Command to create a new directory.
Modify the port or display settings.
Display one page at a time.
Move one or more files from one directory to another directory.
Early Microsoft Virus scanner.
Diagnostics utility.
Utility used to load and provide access to the CD-ROM.
Displays protocol statistics and current TCP/IP connections using NBT
Update, fix, or view the network or network settings
Configure dynamic and static network information from MS-DOS.
Display the TCP/IP network protocol statistics and information.
Load country specific information.
Look up an IP address of a domain or host on a network.
View and modify the computers path location.
View and locate locations of network latency.
Command used in batch files to stop the processing of a command.
Test and send information to another network computer or network device.
Changes to the directory or network path stored by the pushd command.
Conserve power with computer portables.
Prints data to a printer port.
View and change the MS-DOS prompt.
Stores a directory or network path in memory so it can be returned to at any time.
Open the QBasic.
Removes an empty directory.
Renames a file or directory.
Renames a file or directory.
Removes an empty directory.
A robust file copy command for the Windows command line.
View and configure windows network route tables.
Enables a user to run a program as a different user.
Run the scandisk utility.
Scan registry and recover registry from errors.
Change one variable or string to another.
Enables local environments to be changed without affecting anything else.
Change MS-DOS version to trick older MS-DOS programs.
Installs support for file sharing and locking capabilities.
Changes the position of replaceable parameters in a batch program.
Shutdown the computer from the MS-DOS prompt.
Create a disk cache in conventional memory or extended memory.
Sorts the input and displays the output to the screen.
Start a separate window in Windows from the MS-DOS prompt.
Substitute a folder on your computer for another drive letter.
Remove add functions from MS-DOS.
Transfer system files to disk drive.
Telnet to another computer or device from the prompt.
View or modify the system time.
Change the title of their MS-DOS window.
Visually view a network packets route across a network.
View a visual tree of the hard drive.
Display the contents of a file.
Undelete a file that has been deleted.
Unformat a hard drive.
Unlock a disk drive.
Display the version information.
Enables or disables the feature to determine if files have been written properly.
Displays the volume information about the designated drive.
Copy multiple files, directories, or drives from one location to another.













DIR

Displays a list of files and subdirectories in a directory.

SYNTAX

DIR [drive:][path][filename] [/P] [/W] [/A[[:]attributes]] [/O[[:]sortorder]] [/S] [/B] [/L] [/V]
  • [drive:][path][filename] Specifies drive, directory, and/or files to list.
  • /P Pauses after each screenful of information.
  • /W Uses wide list format.
  • /A displays only files with these attributes:
D Directories
R Read-only files
H Hidden files
A Files ready for archiving
S System files
- Prefix meaning not: can be added to above attributes
  • /O List by files in sorted order, sortorder:
N By name (alphabetic)
S By size (smallest first)
E By extension (alphabetic)
D By date & time (earliest first)
G Group directories first
A By Last Access Date (earliest first)
- Prefix to reverse order: put in front of above
  • /S Displays files in specified directory and all subdirectories.
  • /B Uses bare format (no heading information or summary).
  • /L Uses lowercase.
  • /V Verbose mode.
EXAMPLES
dir - Lists all files and directories in the directory that you are currently in.
dir /s - Lists the files in the directory that you are in and all sub directories after that directory.
dir /p - If the directory has a lot of files and you cannot read all the files you can use this command and it will display all files one page at a time.
dir /w - Lists just the files and directories, going horizontal, and taking as little as space needed.
dir /a:-s - This would list all the files that aren't system files in the current directory.

CD


Changes the current directory

SYNTAX
CD [drive:][path]
CD[..]
EXAMPLES
cd \ - Changes current directory to the highest level of the current drive (the root directory).
cd .. - Goes up one directory. For example if you are within the C:\WINDOWS\COMMAND> directory this would take you to C:\WINDOWS>
cd windows - Changes to the Windows subdirectory of the current directory (if it exists).
Note: If you want to change to a different drive, CD will not switch to it. CD only changes directories in the current drive. To change drives, type the drive letter followed by a colon. i.e. cd d: will not switch to the d drive, but d: will switch drives.

COPY


Copies one or more files to another location.
See note on DOS vs. Windows file names above. If trying to copy files longer the 8 characters, DOS will truncate them with normal COPY. Also COPY will not move all files, it will leave Hidden and System files alone. Use XCOPY instead to solve both of these issues.

SYNTAX

COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination] [/A | /B]] [/V] [/Y | /-Y]
  • source Specifies the file or files to be copied.
  • /A Indicates an ASCII text file.
  • /B Indicates a binary file.
  • destination Specifies the directory and/or filename for the new file(s).
  • /V Verifies that new files are written correctly.
  • /Y Suppresses prompting to confirm you want to overwrite an existing destination file.
  • /-Y Causes prompting to confirm you want to overwrite an existing destination file.
To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format).

EXAMPLES
copy *.* a: - This would copy all files in the current directory to the floppy disk in drive a:
copy autoexec.bat c:\windows - Copies autoexec.bat from the current directory to the Windows directory of the C: drive.
copy file1.txt+file2.txt+file3.txt newfile.txt /v - This would add together (concatenate) file1.txt, file2.txt and file3.txt and store the results in newfile.txt, then verify that it copied correctly.

DELETE


Deletes one or more files.

SYNTAX

DEL [drive:][path]filename [/P]
  • [drive:][path]filename - Specifies the file(s) to delete. Specify multiple files by using wildcards.
  • /P - Prompts for confirmation before deleting each file.
EXAMPLES
del test.tmp - Deletes test.tmp from the directory you are currently in (if it exists).
del c:\windows\test.tmp - Deletes test.tmp from the C:\Windows directory (if it exists).
del c:\windows\temp\*.* /P - Deletes all files in the C:\Windows\temp directory, and requires confirmation for each file.

XCOPY


Xcopy is a powerful version of the copy command with additional features. It has the ability to move files, directories and even whole drives from one destination to another. It also can preserve file attributes and long file names.
Note: XCOPY is in all versions of Windows, but may not run unless it is located in the command Path. Please see the note on Paths above. The actual file is called xcopy.exe and is located on Windows 98 and ME in the C:\Windows\Command directory on Windows NT and 2000 in the C:\Winnt\system32 and on Windows XP in the C:\Windows\system32 directory.

SYNTAX

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/W] [/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U] [/K] [/N]
  • source - Specifies the file(s) to copy.
  • destination - Specifies the location and/or name of new files.
  • /A - Copies files with the archive attribute set, doesn't change the attribute.
  • /M - Copies files with the archive attribute set, turns off the archive attribute.
  • /D:date - Copies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time.
  • /P Prompts you before creating each destination file.
  • /S Copies directories and subdirectories except empty ones.
  • /E Copies directories and subdirectories, including empty ones.
  • /W Prompts you to press a key before copying.
  • /C Continues copying even if errors occur.
  • /I If destination does not exist and copying more than one file, assumes that destination must be a directory.
  • /Q Does not display file names while copying.
  • /F Displays full source and destination file names while copying.
  • /L Displays files that would be copied.
  • /H Copies hidden and system files also.
  • /R Overwrites read-only files.
  • /T Creates directory structure, but does not copy files. Does not include empty directories or sub directories. /T /E includes empty directories and sub directories.
  • /U Updates the files that already exist in destination.
  • /K Copies attributes. Normal xcopy will reset read-only attributes.
  • /Y Overwrites existing files without prompting.
  • /-Y Prompts you before overwriting existing files.
  • /N Copy using the generated short names.
EXAMPLES
xcopy h:\*.* /a /e /k - Copies everything located on the H drive to the current drive.
xcopy c:\windows\desktop c:\desktop /a /e /f /h /k - Copies all files and folders in the C:\Windows\Desktop folder to the C:\Desktop folder.

DELTREE


Deletes a directory and all the subdirectories and files in it.
Note: DELTREE is in all versions of Windows with the exception of Windows NT, 2000 and XP, but may not run unless it is located in the command path. Please see the note on Paths above. The actual file is called deltree.exe and is located in the C:\Windows\Command directory.

SYNTAX

DELTREE [/Y] [drive:]path [[drive:]path[...]]
  • /Y - Suppresses prompting to confirm you want to delete the subdirectory.
  • [drive:]path - Specifies the name of the directory you want to delete. More then one path can be specified.
Note: Use DELTREE cautiously. Every file and subdirectory within the specified directory will be deleted. Once deleted you cannot recover the information.

EXAMPLES
deltree c:\windows\fake010 = Deletes the fake010 directory and everything in it.

MOVE


Moves files and renames files and directories.

SYNTAX

To move one or more files: MOVE [/Y | /-Y] [drive:][path]filename1[,...]destination
To rename a directory: MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2 [drive:][path]
  • [drive:][path]filename1 - Specifies the location and name of the file or files you want to move. (Multiple files separated by a comma)
  • [drive:][path]Destination - Specifies the new location of the file. Destination can consist of a drive letter and colon, a directory name, or a combination.
  • [drive:][path]dirname1 - Specifies the directory you want to rename.
  • dirname2 [drive:][path] - Specifies the new name of the directory.
  • /Y - Suppresses prompting to confirm creation of a directory or overwriting of the destination.
  • /-Y Causes prompting to confirm creation of a directory or overwriting of the destination.
EXAMPLES
move c:\windows\temp\*.* c:\temp - Moves all files from the C:\Windows\temp folder to the C:\temp folder.
move /Y c:\temp temp2 - Moves the C:\temp directory and all contents to the C:\temp2 directory and suppress confirmation.

REN


Renames a file/directory or files/directories.

SYNTAX

REN [drive:][path][directoryname1 | filename1] [directoryname2 | filename2]
Note: you cannot specify a new drive or path for your destination. You can only rename files in the same directory
  • [drive:][path]filename1 - is the source file to rename.
  • [drive:][path]directoryname1 - is the source directory to rename.
  • filename2 - is the new name of the file.
  • directoryname2 - is the new name of the file.
EXAMPLES
ren c:\chope hope - Rename the directory chope to hope.
ren *.txt *.bak - Rename all text files to files with .bak extension.
ren * 1_* - Rename all files to begin with 1_. The asterisk (*) in this example is a wild character this means all files.

MKDIR


Creates a directory.

SYNTAX
MKDIR [drive:]path
MD [drive:]path
EXAMPLES
md test - Creates a directory called test inside the current directory.

RMDIR


Removes (deletes) a directory.

SYNTAX
RMDIR [drive:]path RD [drive:]path
EXAMPLES
rmdir c:\test - Removes the test directory if empty.

ATTRIB


Displays or changes file attributes such as read only, hidden, system, and archive. Attrib is necessary to use most other commands that do not work when some of these attributes are set.
Note: ATTRIB is in all versions of Windows, but may not run unless it is located in the command Path. Please see the note on Paths above. The actual file is called attrib.exe and is located on Windows 98 and ME in the C:\Windows\Command directory on Windows NT and 2000 in the C:\Winnt\system32 and on Windows XP in the C:\Windows\system32 directory.

SYNTAX

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.
EXAMPLES
attrib autoexec.bat - Show the attributes of the autoexec.bat file.
attrib +r autoexec.bat - Makes the autoexec.bat so it cannot be modified until the read only attribute is taken off.
attrib +h config.sys - Hides config.sys from a normal directory listing. However, hidden files are always visible to the attrib command.
attrib -h config.sys - This command does the opposite of the above command. Instead of hiding the file it will unhide it if currently hidden.

PING


Ping is used to determine if a connection exists between your computer, and another computer connected via TCP/IP. It sends small packets of information to the other computer, which are returned if the connection is found, and lost otherwise. Ping is a powerful utility to help determine network related problems.

SYNTAX

ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] destination-list
  • -t - Pings the specified host until stopped.
    To see statistics and continue - type Control-Break;
    To stop - type Control-C.
  • -a - Resolve addresses to hostnames.
  • -n - count Number of echo requests to send.
  • -l - size Send buffer size.
  • -f - Set Don't Fragment flag in packet.
  • -i TTL - Time To Live.
  • -v TOS - Type Of Service.
  • -r count - Record route for count hops.
  • -s count - Timestamp for count hops.
  • -j host-list - Loose source route along host-list.
  • -k host-list - Strict source route along host-list.
  • -w timeout - Timeout in milliseconds to wait for each reply.
EXAMPLES
ping localhost - Pings the localhost (127.0.0.1). This determines whether the ethernet card is able to send and receive data. Note that this does not send information over a network, so its main use is troubleshooting network card problems.

C:\>ping localhost

Pinging 127.0.0.1 with 32 bytes of data:

Reply from 127.0.0.1: bytes=32 time Reply from 127.0.0.1: bytes=32 time Reply from 127.0.0.1: bytes=32 time=1ms TTL=128
Reply from 127.0.0.1: bytes=32 time=1ms TTL=128

Ping statistics for 127.0.0.1:
Packets: Sent=4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms

ping xxx.xxx.xxx.xxx - Allows you to ping another computer where the x's are located are where you would place the IP address of the computer you are attempting to ping. If this is not able to complete this should relay back an unsuccessful message (request timed out) which could be an indication of cable issues, network card issues, hub issue, etc.
ping helpdesk.doit.wisc.edu - can be used to see if computer is connected to the internet by sending a packet to a known web site, in this case the DoIT Helpdesk page.

C:\>ping helpdesk.doit.wisc.edu

Pinging helpdesk.doit.wisc.edu[144.92.9.69] with 32 bytes of data:

Reply from 144.92.9.69: bytes=32 time=2ms TTL=254
Reply from 144.92.9.69: bytes=32 time=1ms TTL=254
Reply from 144.92.9.69: bytes=32 time=2ms TTL=254
Reply from 144.92.9.69: bytes=32 time=1ms TTL=254

Ping statistics for 144.92.9.69:
Packets: Sent=4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 2ms, Average = 1ms

TRACERT


The tracert command is very similar to ping, and is used to visually see a network packet being sent and received and the amount of hops required for that packet to get to its destination. It shows you exactly how far a packet can go before it fails. This will help you know if the connection problem is close, or more towards the destination.

SYNTAX

tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name
  • -d - Do not resolve addresses to hostnames.
  • -h - maximum_hops Maximum number of hops to search for target.
  • -j - host-list Loose source route along host-list.
  • -w - timeout Wait timeout milliseconds for each reply.
EXAMPLES
The following is an example when we used tracert on helpdesk.doit.wisc.edu. As you can see in the below example we had a very short list / time to get to its destination because we are so close to the web server.
C:\>tracert helpdesk.doit.wisc.edu

Tracing route to helpdesk.doit.wisc.edu [144.92.9.69]
over a maximum of 30 hops:

1 2
Trace complete.

Here is another tracert to Google.com, a much further destination.

C:\>tracert www.google.com

Tracing route to google.lb.google.com [216.239.37.100]
over a maximum of 30 hops:

1 2 3 4 5 40 ms 40 ms 40 ms aads.above.net [206.220.243.71]
6 40 ms 30 ms 51 ms core1-core2-oc3-2.ord1.above.net [209.249.0.129]
7 40 ms 50 ms 50 ms core2-ord1-oc48.ord2.above.net [208.185.0.202]
8 50 ms 60 ms 60 ms lga1-ord2-oc48.lga1.above.net [208.185.156.158]
9 80 ms 80 ms 81 ms iad1-lga1-oc48-2.iad1.above.net [216.200.127.61]
10 90 ms 80 ms 90 ms core2-iad1-oc48.iad4.above.net [208.185.0.134]
11 80 ms 90 ms 80 ms main2colo1-core2-oc12.iad4.above.net [208.185.0 70]
12 61 ms 70 ms 60 ms 64.124.113.173.available.google.com [64.124.113 173]
13 60 ms 70 ms 60 ms 216.239.47.26
14 91 ms 100 ms 100 ms www.google.com [216.239.37.100]

Trace complete.

No comments:

Post a Comment