Dos Commands Every Geek Should Know

Hello !!
Today I'm posting out some useful commands that every geek should know. So just go through it or save them for your future use. You can do lot with the help of these commands and with the faster speed if compared with Softwares. Some of these commands may not work on your windows because they might be blocked in your OS version.
If you don't know how to open the CMD Prompt or DOS window, then all you have to do is click on the Start menu, and in the “Search programs and files” field, just type “cmd” and press enter. Voila – there’s your DOS window.So know try out the given below useful commands.

Assoc: Associated Extension

Not sure what default program you have set up to handle ZIP, MP3,HTML files, wmv,excel files, etc?
 A quick and easy way to check for your default file associations is the “assoc” command. Just open a command prompt and type “assoc” followed by the file extension. If you want to know all the default programs for all file types, then simply type "assoc" and hit enter.
dos commands
Like if u type "assoc .zip". The response is the installed application that is currently configured to handle that file type. As you can see above, WinRAR is my ZIP file handler, MS Word handles doc files, and Chrome is set up as the default for HTML files.

Tree: View Directory Structure

If you’ve created a virtual spiderweb of files and directories on your computer, it can get pretty confusing to remember where everything is. Sometimes it would be nice to have a diagram showing directories and sub-directories. Using the Tree command, you can do just that.
First, navigate to the directory you want to get the file structure of, and then type “tree > myfile.txt“. This "myfile.txt" can be of any name. in this file all your directories tree structure will be written.
ms dos commands
The command writes the entire directory structure, completed with all folders, into the text file, which you can print out for easy viewing.
ms dos commands
The formatting may look a little bit funky, but if you look closely you’ll see that the directories are all there, they just might be prefaced with some weird symbols. A with two dots on head symbolise space.

File Search & Comparison

If you ever have two text files – particularly two very large text files – the file compare (fc) command is all you need to identify and synchronize file differences.
The usage is about as easy as it can get. Just typefcfollowed by the names of the two files.
ms dos commands
The system will respond by showing the lines from both files where there are differences.  This command can become pretty handy when you’re collaborating with people and trying to sync up differences between files that several people are working on.
If you only need to find a file on your system, and you know the name of the file, the “find” command is far faster than any point and click operation you can do. Just do a “dir” command to the directory you want to search, and then “|” followed by the name of the file.
dos prompt commands
The system will respond with the directory where the file is stored.

Network Commands

I really don’t think there are easier ways available to do network troubleshooting than the sort of tools you get in DOS commands. For example, if you want to know your basic network setup, just do a quick “ipconfig” and you will get details like your computer IP and the default gateway (which is typically your home router IP address).

If you’re not sure you have a good network connection, try doing a “ping” to a known IP address or a website. Like if you want to do ping test on facebook.com then in cmd box just type "ping www.facebook.com" if u see the packets sent =4 and packets recieved = 4 and lost =0% , then it means your connection is working well.




 If you want to see all network connections currently active from your PC, type “netstat“. It will dispaly all the protocols you are using currently like http, https, ftp,smtp and the TCP/IP of all current connections you are having.
It may be a good idea to search through these carefully to make sure that there’s no surprises in the form of malware or a virus hijacking your bandwidth.

Windows Utilities

Finally, there are a multitude of DOS commands that are invaluable as system troubleshooting tools. For example, to view a list of active processes, just open up a command prompt and type “tasklist“. It's like bringing task manager in the cmd prompt.
dos prompt commands
If you see any process you want to kill, just type “taskkill” followed by the image name. Like if you want to kill the application notepad.exe then type taskkill /IM notepad.exe . Hence the syntax is taskkill /IM "process name". If you want to kill all the instances of the process then use "taskkill /PID "process ID" " all things are without quotes. Now if you want to kill  all the process of a user then you have to write the command as given below taskkill /F /FI "USERNAME eq name of the user". In this you have to apply the quotes as specified and instead of line name of the user just type the username whose all process you wanna to kill.
Nervous about whether a particular system file became corrupted after a recent virus infection? Just type “sfc /VERIFYFILE=” followed by the full path of the file. But remember you must be an administrator to do this.
dos prompt commands
Windows will check to be sure it is the original. You can also scan all system files like this at once by typing “sfc /scannow

Now one of the basic thing is how to come out of the directory/folder or how to change the directory. for that one of the simple thing is just type "cd..". each type you type cd.. you will come out of the innermost folder and after coming to drive like "c:\>" you can change your drive. for it type simply "drive name :" and hit enter. Like "d:", it will change drive to d.
Finally, probably one of the most useful DOS commands available – the AT command. With “AT”, you have the ability to schedule tasks to run on a regular routine, all from a simple command prompt.
dos commands
Setting up the AT commands can be a little tricky, so type “at help” if you need parameter help. In the command above I set up the computer to automatically archive all files in the temp directory to the archive folder. You could do similar jobs to routinely back up important files on your computer to a mapped external drive.

If you don't know how to use a command then type "command_name \?" and hit enter. TO know all the useful commands type "help " and hit enter.

type - open text files sans Notepad
Similar to Unix cat command, Type is my favorite DOS command 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. for example just type in cmd "type  "filepathfollowed by filename.extension"", remember you have to use it without quotes.

attrib - make hidden files visible
Attrib lets you change attributes of System files and even hidden files. This is great for troubleshooting Windows XP. Say your XP doesn't boot ever since you edited that startup boot.ini file (Hidden), use attrib to remove the Hidden attibute and edit the file using EDIT dos command. You can edit even the files which are automatically hidden and private. But remember its risky to edit the hidden files like boot and all.

move - more flexible than copy-paste
Say you got a lot of XLS and DOC files in you MyDocuments 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 make things much simpler. Just type the following at the command prompt:
move *2006.xls c:\2006Reports\. Here it will move all the files ending with 2006.xls to folder 2006 reports in c drive.

find - advanced file search with filter
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" . In this you have to specify the directory like here it is "c". remember to put the string to be searched in the double quotes. It will search much fast than windows find wizard.

Quick Tip - Drag to avoid typing: When your command acts on a file or folder, you must type the path to that folder after the command. You can save typing time by dragging the file or folder from Windows Explorer into the command window. It will automatically writes the path of the file in cmd box.

Quick Tip- If you want to open/play any file you can also do by just dragging into cmd window and hit enter. It will automatically get opened in the default program.

To view help at the command-line, at the command prompt, type the following:
CommandName /?

Remaining useful commands are stated below, these are simple i hope these are need not to be explained.

ARP — Address Resolution Protocol.
BOOTCFG — Edit Windows boot settings.
BROWSTAT — Get domain, browser and PDC info.
CACLS — Change file permissions
CALL — Call one batch program from another.
CHKDSK — Check Disk – check and repair disk problems. Required to be an administrator.
CHKNTFS — Check the NTFS file system.
CHOICE — Accept keyboard input to a batch file.
CIPHER — Encrypt or Decrypt files/folders.
CleanMgr — Automated cleanup of Temp files, recycle bin. If you are in the c directory then it it will ask for drive to clean, and after selecting the drive it will clean it. But if you are using it as a user means "c:/users/leroy" then it will delete the temp files and recycle bin.
CLIP — Copy STDIN to the Windows clipboard. Places the copy of a file on the windows clipboard.
CLS — Clear the screen.
CLUSTER — Windows Clustering. It may not work in windows.
COLOR — Change colors of the CMD window. command is  color "code". to get to know all the available colour codes just type color /? and press enter.
COMPACT — Compress files or folders on an NTFS partition.
COMPRESS — Compress individual files on an NTFS partition.
CON2PRT — Connect or disconnect a Printer.
CONVERT — Convert a FAT drive to NTFS.
DATE — Display or set the date.
Dcomcnfg — DCOM Configuration Utility.
DEFRAG — Defragment hard drive.
DEL — Delete one or more files.
DELPROF — Delete NT user profiles.
DELTREE — Delete a folder and all subfolders.
DevCon — Device Manager Command Line Utility.
DIR — Display a list of files and folders.
DIRUSE — Display disk usage.
DISKCOMP — Compare the contents of two floppy disks
DISKCOPY — Copy the contents of one floppy disk to another
DNSSTAT — DNS Statistics.


So subscribe our Blog to kick off your day with our free stuff.

0 comments: