Tuesday, January 02, 2007

WIN XP Commands

Command-line tools must be run at the Command prompt .To open Command Prompt, click Start, click Run, type cmd, and then click OK. We can use any Command with or without parameters. You can get help for any command at the command Prompt by typing CommandName /?

1.ASSOC
This Command displays or modifies file name extension associations. Without parameters, assoc displays a list of all the current file name extension associations.

Parameters
.ext :
Specifies the file name extension.
filetype : Specifies the file type with which you want to associate the specified file name extension.

Syntax
assoc
[.ext[=[filetype]]]

Examples
Assoc .log
View the current file type association for the file name extension .log.
assoc .log=
Delete the file type association for the file name extension .log.
assoc more
View current file type associations one screen at a time.
assoc>assoc.cfg
Send the output of assoc to the file Assoc.cfg.

2.Attrib
This windows xp command Displays, sets, or removes the read-only, archive, system, and hidden attributes assigned to files or directories. Without parameters, attrib displays attributes of all files in the current directory.

Parameters
+r :
Sets the read-only file attribute.
-r : Clears the read-only file attribute.
+a : Sets the archive file attribute.
-a : Clears the archive file attribute.
+s : Sets the system file attribute.
-s : Clears the system file attribute.
+h : Sets the hidden file attribute.
-h : Clears the hidden file attribute.
[Drive:][Path] FileName : Specifies the location and name of the directory, file, or set of files for which you want to display or change attributes. You can use wildcard characters (that is, ? and *) in the FileName parameter to display or change the attributes for a group of files.
/s : Applies attrib and any command-line options to matching files in the current directory and all of its subdirectories.
/d : Applies attrib and any command-line options to directories.

Syntax
attrib
[{+r-r}] [{+a-a}] [{+s-s}] [{+h-h}] [[Drive:][Path] FileName] [/s[/d]]

Examples
attrib gta.doc
Display the attributes of a file named gta.doc located on the current drive.
attrib +r gta.doc
Assign the read-only attribute to the file gta.doc.
attrib -r gta.doc
Remove the read-only attribute from the file gta.doc.


3. Chkdsk
This windows xp command creates and displays a status report for a disk based on the file system. Chkdsk lists and corrects errors on the disk. Without parameters, chkdsk displays the status of the disk in the current drive.

Parameters
volume: :
Specifies the drive letter (followed by a colon), mount point, or volume name.
[Path] FileName : Specifies the location and name of a file or set of files that you want chkdsk to check for fragmentation. You can use wildcard characters (that is, * and ?) to specify multiple files.
/f : Fixes errors on the disk. The disk must be locked. If chkdsk cannot lock the drive, a message appears that asks you if you want to check the drive the next time you restart the computer.
/v : Displays the name of each file in every directory as the disk is checked.
/r : Locates bad sectors and recovers readable information. The disk must be locked.
/x : Use with NTFS only. Forces the volume to dismount first, if necessary. All open handles to the drive are invalidated. /x also includes the functionality of /f.
/i : Use with NTFS only. Performs a less vigorous check of index entries, reducing the amount of time needed to run chkdsk.
/c : Use with NTFS only. Skips the checking of cycles within the folder structure, reducing the amount of time needed to run chkdsk.
/l[:size] : Use with NTFS only. Changes the log file size to the size you type. If you omit the size parameter, /l displays the current size.

Syntax
chkdsk
[volume:][[Path] FileName] [/f] [/v] [/r] [/x] [/i] [/c] [/l[:size]]

Examples
chkdsk e: /f
Check the disk in drive E and have Windows fix errors.
If it encounters errors, chkdsk pauses and displays messages. Chkdsk finishes by displaying a report that lists the status of the disk. You cannot open any files on the specified drive until chkdsk finishes.
chkdsk *.*
Check all of files on a FAT disk in the current directory for noncontiguous blocks.
Chkdsk displays a status report, and then lists the files matching the file specification that have noncontiguous blocks.

4.Cls
This windows xp command Clears the Command Prompt window.

5.Cmd
This windows xp command Starts a new instance of the command interpreter, Cmd.exe. Without parameters, cmd displays Windows XP version and copyright information.

Parameters
/c :
Carries out the command specified by string and then stops.
/k : Carries out the command specified by string and continues.
/s : Modifies the treatment of string after /c or /k.
/q : Turns the echo off.
/d : Disables execution of AutoRun commands.
/a : Creates American National Standards Institute (ANSI) output.
/u : Creates Unicode output.
/t:fg : Sets the foreground f and background g colors. We can use hexadecimal digits as the values for f and g. We can give from 0 to 9, A to F as the values for f and g.
/e:on : Enables command extensions.
/e:off : Disables commands extensions.
/f:on : Enables file and directory name completion.
/f:off : Disables file and directory name completion.
/v:on : Enables delayed environment variable expansion.
/v:off : Disables delayed environment variable expansion.
string : Specifies the command you want to carry out.

Example
Cmd /t:c7

This windows xp command sets the background color to red(c for red) and fore ground color to white(7 for white). By this command we will get command prompt window with red background and with white lettering on it.

6.Convert
This windows xp command Converts FAT and FAT32 volumes to NTFS.

Syntax
convert
[volume] /fs:ntfs [/v] [/cvtarea:FileName] [/nosecurity] [/x]

Parameters
volume Specifies the drive letter (followed by a colon), mount point, or volume name to convert to NTFS. /fs:ntfs Required. Converts the volume to NTFS. /v Specifies verbose mode, that is, all messages will be displayed during conversion. /cvtarea:FileName For advanced users only.
/nosecurity Specifies that the converted files and directory security settings are accessible by everyone. /x Dismounts the volume, if necessary, before it is converted. Any open handles to the volume will no longer be valid.

Example
convert f: /fs:ntfs /v
Convert the volume on drive F to NTFS and display all messages.


7. Defrag
This windows xp command Locates and consolidates fragmented boot files, data files, and folders on local volumes.

Syntax
defrag
volume
defrag volume [/a]
defrag volume [/a] [/v]
defrag volume [/v]
defrag volume [/f]

Parameters
volume : The drive letter or a mount point of the volume to be defragmented.
/a : Analyzes the volume and displays a summary of the analysis report.
/v : Displays the complete analysis and defragmentation reports.
When used in combination with /a, displays only the analysis report. When used alone, displays both the analysis and defragmentation reports.
/f : Forces defragmentation of the volume regardless of whether it needs to be defragmented.

8. Driverquery
This windows xp command Displays a list of all installed device drivers and their properties.

Syntax
driverquery
[/s Computer] [/u Domain\User /p Password] [/fo {TABLELISTCSV}] [/nh] [/v] [/si]

Parameters
/s Computer :
Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer.
/u Domain\User : Runs the command with the account permissions of the user specified by User or Domain\User. The default is the permissions of the current logged on user on the computer issuing the command.
/p Password : Specifies the password of the user account that is specified in the /u parameter.
/fo {TABLELISTCSV} : Specifies the format to display the driver information. Valid values are TABLE, LIST, and CSV. The default format for output is TABLE.
/nh : Omits the header row from the displayed driver information. Valid when the /fo parameter is set to TABLE or CSV.
/v : Specifies that detailed driver information be displayed.
/si : Displays digital signature information for both signed and unsigned device drivers.

Examples
driverquery
driverquery /fo csv

driverquery /nh
driverquery /s ipaddress

9 Format
This windows xp command Formats the disk in the specified volume to accept Windows files.

Examples
format a:
Format a new floppy disk in drive A using the default size.
format a: /q
Perform a quick format operation on a previously formatted disk in drive A.
format a: /v:KARRI
Format a floppy disk in drive A and assign it the volume label KARRI.


10. Getmac
This windows xp command Returns the media access control (MAC) address and list of network protocols associated with each address for all network cards in each computer, either locally or across a network.

11. Hostname
This windows xp command Displays the host name portion of the full computer name of the computer.

12. Ipconfig
This windows xp command Displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings. Without parameters, ipconfig displays the IP address, subnet mask, and default gateway for all adapters.

Examples
Ipconfig
Displays the basic TCP/IP configuration for all adapters.
ipconfig /all
Displays the full TCP/IP configuration for all adapters.
ipconfig /release
Sends a DHCPRELEASE message to the DHCP server to release the current DHCP configuration and discard the IP address configuration for either all adapters.
ipconfig /renew "Local Area Connection"
Renew a DHCP-assigned IP address configuration for only the Local Area Connection adapter.
ipconfig /flushdns
Flush the DNS resolver cache when troubleshooting DNS name resolution problems.
ipconfig /showclassid Local
Displays the DHCP class ID for all adapters with names that start with Local.
ipconfig /setclassid "Local Area Connection" TEST
Set the DHCP class ID for the Local Area Connection adapter to TEST.

13. Label
This windows xp command Creates, changes, or deletes the volume label (that is, the name) of a disk. Without parameters, label changes the current volume label or deletes the existing label.

14. Msinfo32
This windows xp command Displays a comprehensive view of your hardware, system components, and software environment.

Examples
msinfo32 /showcategories
Lists the available category IDs.
msinfo32 /categories +all -loadedmodules
Start System Information with all available information displayed, except Loaded Modules.
msinfo32 /nfo syssum.nfo /categories +systemsummary
Display only System Summary information and create an .nfo file called syssum.nfo that contains information in the System Summary category.
msinfo32 /nfo conflicts.nfo /categories +componentsproblemdevices
+resourcesconflicts+resourcesforcedhardware

Display resource conflict information and create an .nfo file called conflicts.nfo that contains information about resource conflicts.

15. Nbtstat
This windows xp command Displays NetBIOS over TCP/IP (NetBT) protocol statistics, NetBIOS name tables for both the local computer and remote computers, and the NetBIOS name cache. Nbtstat allows a refresh of the NetBIOS name cache and the names registered with Windows Internet Name Service (WINS). Without parameters, nbtstat displays help.

Examples
nbtstat -n
Display the NetBIOS name table of the local computer.
nbtstat -c
Display the contents of the local computer NetBIOS name cache.
nbtstat -R
Purge the NetBIOS name cache and reload the PRE-tagged entries in the local Lmhosts file.
nbtstat -RR
Release the NetBIOS names registered with the WINS server and re-register them.
nbtstat -S 5
Display NetBIOS session statistics by IP address every five seconds.
nbtstat -a CORPO10
Display the NetBIOS name table of the remote computer with the NetBIOS computer name of CORPO10.
nbtstat -A 10.0.0.77
Display the NetBIOS name table of the remote computer assigned the IP address of 10.0.0.77.

16. Regsvr32
This command-line tool registers .dll files as command components in the registry.

Examples
regsvr32 schmmgmt.dll
Register the .dll for the Active Directory Schema.

17. Systeminfo
This windows xp command Displays detailed configuration information about a computer and its operating system, including operating system configuration, security information, product ID, and hardware properties, such as RAM, disk space, and network cards.

18. System File Checker (sfc)
This windows xp command Scans and verifies the versions of all protected system files and replaces incorrect versions with correct Microsoft versions.

Examples
sfc /scannow : Scans all protected system files immediately.
sfc /scanonce : Scans all protected system files once.
sfc /scanboot : Scans all protected system files every time the computer is restarted.
sfc /revert : Returns the scan to its default operation.
sfc /purgecache : Purges the Windows File Protection file cache and scans all protected system files immediately.
sfc /cachesize=x : Sets the size, in MB, of the Windows File Protection file cache.

19. Ver
This windows xp command Displays the Windows XP version number.

20. Vol
This windows xp command Displays the disk volume label and serial number, if they exist. A serial number is displayed for a disk formatted with MS-DOS version 4.0 or later.

Syntax
vol
[Drive:]

21. Winnt32
This windows xp command Performs an installation of or upgrade to Windows XP. You can run winnt32 at the command prompt on a computer running Windows 95, Windows 98, Windows Millennium Edition, Windows NT, Windows 2000, or Windows XP.

No comments: