Some Obscure Dos Commands

Some Obscure Dos Commands
1st January 2009 No Comments Uncategorised admin

 

1.ATTRIB:

This is used to change the file directory attributes.The attributes include hidden,read only,archive.

Go to command Prompt.

c:\>type attrib and press enter, this will show files with their attributes.

S- System File

R-Read Only

H-Hidden

A-Archive

Type attrib + <attribute> file/directory name to set up an attribute.

Type attrib – <attribute> file/directory name to remove an attribute.

eg. attrib +h a.mpg will hide that file.

Now this can be done through right clicking the folder and choosing properties and ticking hidden/readonly but the shell method is a faster one.

Generally typing help at the dos prompt will give you all the help of DOS commands.

 

 

2. TASKLIST(Vista only)- It is similar to ps command in linux.It will list all the current processes running in the system with the memory used by them with their process ID's.

 

 

3. TASKKILL-It is similar to Kill command in Linux.It can be used to end /terminate any process.

Eg. TASKKILL /PID 2236 will kill a process with PID 2236

 

 

4.START-Start is a useful command in DOS. It can be used to start any windows application.

 

Eg . Start notepad.exe or start notepad

This command will start the notepad application.

 

 

5.SHUTDOWN: Allows the users to shutdown the machine.

Shutdown /r -To restart computer(vista)

Shutdown -r(XP)

 

6.DISKPART– This will help in partitioning the disk.

 

 

7.BOOTCFG-This command is used to configure the boot.ini file.

Boot.ini is an important file,One should always make a backup of it before changing it.To execute BootCFG you will need to have administrator privileges.

To start cmd  with adminstrator privileges go to start->All Programs->Accessories->Command Prompt

Right Click on command prompt , click on "run as administrator".

 

8.HOSTNAME : This command when issued displays the name of your computer.Name of the computer can also be found out by going to settings->control panel->system.

9.GetMac- GetMac is used to display Mac address.Mac address can be of your ethernet card,Wifi Card or bluetooth card.

 

9. Systeminfo- This command displays the details about the system information.This is particularly useful when our windows OS has crashed, we have lost our drivers disk and we wish to see the system information to find out details about our motherboard and chipset so that we can download the drivers from the net.If we are able to boot the system in DOS mode then we can type this command and access the system information.

 

10. Compact-This command is used to compress/de-compress files for ntfs file system.

Type compact <file name> /C to compress the file.

To uncompress the file type compact <file name> /U.

 

12.Comp:-It is used to compare two or more files.Syntax: comp <file1> <file2>

If both the files are same then it displays "files are same size" otherwise it displays "files are different size".

 

13. Driverquery:It is used display the list of drivers installed in a system.

 

/s- specifies the system that we are targeting.127.0.0.1 implies the localhost machine(our own system).We can also target any remote system or any other system connected through LAN.

/V-Verbose mode , displays the information in detail.

> – We have stored the output of this command into m.txt file.

 

14. Convert : This command is used to convert a FAT volume into NTFS.

 

 

15. run as : "run as" is used to run the program/command with administrator privileges.Suppose a person 'X' is logged on to the system and he wishes to execute a program which requires administer level privileges,then rather than logging off and logging back in with administer level privileges, he can "run the program as an administrator".

To see other DOS Utilities go to c:\windows\system32 – Type dir *.exe and press enter

This will list all the .exe files.

16. Time Out : Time out waits for a specified time(takes a time out for a specified time).This may come in handy when we are writing batch scripts and we wish to delay an operation for some particular time.

Here 10 represents no.of seconds to wait. /T represents time in seconds.

 

17.Whoami -This command is used to get user and group information about the user who is currently logged in to the system.

 

18. where: Where is used to locate files in the system.It is similar to 'locate' command in unix.Like 'locate' command in unix this also accepts wildcard character like '*' for a better search.

 

19.SFC(System File Checker)-Good option to use when you feel that your system has got corrupted,because this command checks the integrity of all the protected and system files.It then tries to replace the incorrect versions of the file with correct version.

About The Author

Leave a reply

Your email address will not be published. Required fields are marked *