Blogger Widgets Blogger Widgets

Tuesday, February 28, 2012

Dos Commands For System Managers

Networking

ipconfig – Windows IP Configuration

This has to the DOS command I use most today. ipconfig will tell you the IP settings for the current computer such as what your current IP is and what subnet/gateway you are on. It is great for troubleshooting. Here are the two most useful commands for ipconfig and usage:

ipconfig /release – This will release any IP information that the computer was given and make your IP address 0.0.0.0


ipconfig /renew – 
This will ask any DHCP servers (usually your modem/router) for a new IP address.
ping – Check a connection or computer
Ping is used to check the health of a connection. The ping command will tell you whether a network device is responding and how fast it is running. The ping tool can also be used to convert a web address into an IP (eg. www.google.com = 74.125.19.99). Usage:
ping www.google.com – Pings a webserver to see if it can be reached or is responding. I personally use this to see if the computer I am on can reach the internet.
ping 192.168.0.1 – Pings a local address, often a modem, router or another computer.



netstat – Displays current TCP/IP connections

netstat – Will display what connections are currently active on the system. Useful for spotting programs calling back to base such as spyware.

File Management

type – Open texts files
Similar to Unix’s cat command, this command will display the contents of a text file in DOS as read-only. Usage:
type c:\sometextfile.txt

attrib – Make hidden files visible
Attrib can change the attributes of a file, such as whether its a system file or its hidden. This is especially useful to technicians because critical files such as the boot.ini is a hidden system file:
attrib -H c:\boot.ini – To unhide the boot.ini
attrib -S c:\boot.ini – To make remove its system file attribute
For more options with this command, type attrib /?

find – Advanced file search
The find command is a very powerful one with many options such as the ability to search for something, but exclude certain files. 
The following command will find all files with .pdf in their name on C:\
dir c:\ /s /b | find ".pdf"
For more information in this command and its usage, type find /?

move – Move files
Normal usage of the move command would be:
move file.txt c:\TextFiles\
However, you can also use it to move only certain files. For example, if I wanted to get all the PDF’s out of a folder and move them to another location, but leave all other file types alone, I would do:
move *.pdf c:\WorkPDFs\

tree – View the tree structure
Type tree to see the folder and file structure of the folder you are currently in. You can also use this command to make prints of the directory structure by sending the information to a text file with the following command tree > textfile.txt

System

systeminfo – Displays information about the system
systeinfo – Will display information about the system such as the name, version, uptime, specifications and patches installed.
tasklist / taskkill – Shows what programs are running on the computer and can kill them
tasklist – Will display all the processes running and their memory usage.
taskkill – Will kill a process. Usage would be: taskkill firefox.exe
sfc – Launches Windows’ system file checker utility
sfc /scannow – This command will start scanning your computer for any damaged or missing windows system files. Useful to run after a virus, adware or spyware attack has damaged core files. Have an XP CD handy for this one.
chkdsk – Can check a disk and attempt to recover data in bad sectors.
chkdsk /f /r – This will check a disk for errors and try and fixes information from bad sectors
chkdsk /x – Forces the volume to dismount first.


No comments:

Post a Comment