
DOS Command-line tools must be run at the prompt of the Cmd.exe command interpreter. To open Command Prompt, click Start, click Run, type cmd, and then click OK.
(Attrib) - Make hidden files visible
Attrib lets you change attributes of System files and even hidden files. Use the command as follows:
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.
[drive:][path][filename] Specifies a file or files for attrib to process.
/S Processes matching files in the current folder and all subfolders.
/D Processes folders as well.
(COPY) - Make a copy of a file or merge files together
COPY original-file destination-file
Where original-file and destination-file are file names, separated by a space. The command can be used to merge several files into one since the original-file parameter can be a list of filenames separated by the + symbol. For example: COPY file1 + file2 file3 would copy file1 and file2 into file3.Note that the file names used in the copy command must include the file extension if it exists. So if you were copying FORTRAN program called first.for, for example, you would need to include the .for extension in the filename.
(DEL) - Delete a file
Use the command as follows:
DEL filename
Where filename is the name of the file to be deleted. You are asked to confirm that you really want to delete the file. Note that the name must include the file extension. The amount of space on a disk is limited and it is necessary periodically to tidy up unwanted files. It is possible to use character in a filename to match any sequence of character this feature is very useful when deleting unwanted files
Identical extensions. For example, when developing programs,
DEL *.obj
Will delete every binary (.obj) file in the current directory since an .obj file can always be recreated from the original source program, it is usually unnecessary to keep it.
(DIR) - Obtain a list of the files stored in a directory
If used without options this command will give a list of files the current directory, including any extension (e.g. .for)
Their size.
If used with the option /P, that is:
DIR /P
The same information will be displayed page by page with
Message:
Strike a key when ready at the end of each page. If it is used with the /W option, i.e.
DIR /W
The listing is of names and extensions only and in a more compact format across the page.
(DISKKCOPY) - Take a security copy of your working disk
It is very important to have a second copy of your programs and data in case you lose your disk or it becomes unreadable
For some reason. Use the DISKCOPY command as follows:
DISKCOPY A: A:
where A: denotes the drive the disks will be loaded into. When a copy of your disk is generated in the computer's memory, the
computer tells you to remove the first or source disk and insert the disk, which is to become the copy (the target disk).
Insert the target disk and press ENTER. If the second disk is not formatted it will be formatted automatically. The source disk should be write protected using the tab in the corner in case you mistake it for the target disk
(CHDIR or CD) - Display, or change working directory
Use the command as follows:
CHDIR or CD path
(CHKDSK) - Check disk or file logical structure
Use the command as follows:
CHKDSK pathname
/f - fix problems encountered
/v - verbose; displays file specs
(DISKCOPY) - Copy disk sector by sector
Use the command as follows:
DISKCOPY drive: drive:
Copy disk sector-by-sector rather than file-by-file
(Fc) - Free Beyond Compare in XP
FC is an advanced DOS Command that compares two files and displays the differences between them. Though the file comparison results are not as interactive as Beyond Compare or Altova DiffDog, fc is still very useful. You can even set fc to resynchronize the files after finding a mismatch.
(Find) - Advanced file search with filter
Find and display lines containing string in file
/v - lines NOT containing string
/c - count lines only
/n - display line numbers also
Find is the most powerful DOS command and even more useful than the Windows Desktop Search tool or the Windows Find Wizard. The find command searches for a specific string of text in a file or files. After searching the specified file or files, find displays any lines of text that contain the specified string.
To search your hard disk to find and display the file names on drive C: that contain the string "Google" use the pipe (|) to direct the results of a dir command to find as follows:
dir c: /s /b | find "Google"
(FORMAT) - To format drive
Use the command as follows:
FORMAT drive: (A: drive only)
/1 - single sided
/4 - use double rather than high density (40 tracks)
/8 - use 8 sectors of each track
/n:xx - specifies xx sectors per track
/t:yy - specifies yy tracks
/v - prompt for volume label, up to 11 characters
/f:720 - format at 720 kb
(Ipconfig) - Windows IP configuration
Useful for troubleshooting your internet connection. Displays the current IP address of your computer and the DNS server address. If you call your ISP for reporting a bad internet connection, he will probably ask you to run ipconfig.
(LABEL) - Display or edit volume label
Use the command as follows:
LABEL drive: label
Display, or edit volume label - 11 characters excluding
Most specials
(MKDIR or MD) - Make directory
Use the command as follows:
MKDIR (MD) path
Make directory
(MODE)
Interactively configure various options
(MORE)
Paginates screen output
E.g. type filename | more
(Move) - More flexible than copy-paste
Use the command as follows:
E.g. type filename | more
Say you got a lot of XLS and DOC files in you My Documents folder and want to move only those XLS files that have their name ending with 2006. In XP Explorer, you have to manually select each file and then cut-paste to another folder. However, the DOS move command makes things much simpler. Just type the following at the command prompt:
move *2006.xls c:2006Reports
(Ping) - Say hello to another computer
Ping network command followed by the web-address or IP address tells you about the health of the connection and whether the other party is responding to your handshake request. Ping tool can also be used to convert the web address to a physical IP address.
(RMDIR or RD) - Remove directory
Use the command as follows:
RMDIR (RD) path
Remove empty directory
(SORT) - Sort lines of file
Use the command as follows:
SORT pathname pathname
Sort lines of file alphabetically, ignoring case, to file or
stdout; reads stdin by default
/r - reverse order
/+n - on n’th character in each line, default is first
(Type) - Open text files sans Notepad
Similar to UNIX cat command, Type is DOS command is used for displaying the contents of a text files without modifying them. When used in combination with more switch, type splits the contents of lengthy text files into multiple pages. Avoid using the type command with binary files or you'll hear alien PC beeps and see some Greek characters on your PC.
(VER) - DOS version
Display MS-DOS version
(VERIFY) on! Off
Display or set! Clear disk write verification
(VOL) – display disk volume label
Use the command as follows:
VOL drive:
Display disk volume label
(XCOPY) – copy directory tree
Use the command as follows:
XCOPY pathname pathname
Copy directory tree
/a!m - if archive bit set ! also clears in source
/d:date- modified on or after date only
/s!e - copy subdirectories if not empty ! even if empty
/p - prompt
/v - verify
/w - wait for key press
If renamed to MCOPY it determines automatically whether target is file or directory.
To view help at the command-line, at the command prompt, type the following:
CommandName/?
[...] bit of knowledge about registry keys and also about dos and Script commands here are some useful Dos commands. Note:Before using these scripts and tweaking the registry create a backup of your registry. Now we [...]
ReplyDelete