|
| Screenshot of a DOS directory listing |
Long before Windows came into the market PCs in the early eighties used to be sold with MS-DOS (Microsoft Disk Operating System). It underwent eight major revisions before being dumped. In fact, DOS used to be the underlying operating system for the early versions of Windows.
However, remnants of DOS commands continue to remain in Windows XP, and it is a very powerful tool which allows you to do some tasks more efficiently and faster.
Today the DOS prompt is called the Command Line Prompt. To get in, go to Start—Run in Windows XP and type in cmd. This will open up a black screen with:
C:\Documents and Settings\your username>
The first command to know is dir. This gives a listing of all the files in a folder (called a directory then). The second most important command is Change Directory or cd, which takes you to a different folder.
To try it, go to Start—Run and type cmd. Type in cd\. The backslash helps to take you to your root directory of C:\. For C:\Documents and Settings you would have typed just cd. At C:\ type cd Program Files. This will take you to the folder Program Files.
Here are some of my favourite commands.
To get help type ipconfig, put a space and a backslash followed by a question mark (ipconfig /?).
Rename files: With the ren command you can rename a bunch of files in one shot. For example ren *.qxd *.qxt. Here the star is used as a wild card to define all the filenames.
Windows IP configuration: Every computer is given a unique IP address when you connect to the Internet. It is a series of numbers separated by dots. The command ipconfig displays the current IP address of your computer and the DNS server address. If you call BSNL or Airtel to report a problem with your broadband connection, they will probably ask you to run ipconfig.
Delete files: Often it seems impossible to delete some files on your PC through Windows Explorer. Use del filename to delete the file.
Compare files: Type fc to compares two files or sets of files. The differences between the two will be displayed.
MS-DOS Editor: With Windows you get a text editor at the command prompt. This is accessed by typing edit. The benefit of this is that you can open a file that is giving you problems and identify a junk character. This works best with plain text files.
Get response from another computer: The command for this is ping. Type ping followed by a web address or IP address. This tells you about the health of the connection and whether the other party is responding to your request.
Print contents of your folder: Windows XP has no simple visual way to print the contents of a folder. The tree command converts the output to a text file that can be printed. The way to do it is like this:
tree > myfolder.txt
print myfolder.txt
Change file attributes: Another very useful command is attrib. You can use it to hide files, make them read only files or remove the read only tag. This command is great when you want to remove pen drive viruses as I had explained in an earlier column.
Advanced find: Search in Windows XP takes forever to find what you want. A powerful DOS command in XP, find searches for a specific word in a file or files. After searching find displays all lines of the text that contain the specified word. The best way to search and display the filenames is to use the pipe ( ). This redirects the results of a dir command to find. Thus, to find the word archives your command would be dir c:\ /s /b find "archives". Here /s is used to search all folders and sub-folders; /b is used to just display the word without other frills.
Tip: The pipe is just under Backspace on your keyboard.
Send in your computer- related problems to askdoss@abpmail.com. The solutions will appear soon.
|