Useful windows commands Part-2

Assoc       :assoc  .ext  filetype
Eg: assoc  .saj   sajithfile
.xpl=RealPlayer.PLSPL.6
.xsl=xslfile
.xsn=InfoPath.Solution.2
.xspf=VLC.xspf
.xst=PSTFile
.xvm=VMware.Console.Config
.xxe=WinRAR
.zap=zapfile
.zip=WinRAR.ZIP

At   automating process
The AT command schedules commands and programs to run on a computer at
a specified time and date. The Schedule service must be running to use
the AT command.
AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
[ /EVERY:date[,…] | /NEXT:date[,…]] “command”

\\computername     Specifies a remote computer. Commands are scheduled on the
local computer if this parameter is omitted.
id                 Is an identification number assigned to a scheduled
command.
/delete            Cancels a scheduled command. If id is omitted, all the
scheduled commands on the computer are canceled.
/yes               Used with cancel all jobs command when no further
confirmation is desired.
time               Specifies the time when command is to run.
/interactive       Allows the job to interact with the desktop of the user
who is logged on at the time the job runs.
/every:date[,…]  Runs the command on each specified day(s) of the week or
month. If date is omitted, the current day of the month
is assumed.
/next:date[,…]   Runs the specified command on the next occurrence of the
day (for example, next Thursday).  If date is omitted, the
current day of the month is assumed.
“command”          Is the Windows NT command, or batch program to be run.
Eg: at  \\mig 2:00 every:Friday  “cmd.exe”
Attrib  :Displays or changes file attributes.

ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [drive:][path][filename]
[/S [/D]]

+   Sets an attribute.      –   Clears an attribute.          R   Read-only file attribute.
A   Archive file attribute.      S   System file attribute.      H   Hidden file attribute.
[drive:][path][filename]
Specifies a file or files for attrib to process.
/S  Processes matching files in the current folder
and all subfolders.
/D  Processes folders as well.
Eg:attrib +r sajithtest.txt

Cacls  :Displays or modifies access control lists (ACLs) of files

CACLS filename [/T] [/E] [/C] [/G user:perm] [/R user […]]
[/P user:perm […]] [/D user […]]
filename      Displays ACLs.
/T            Changes ACLs of specified files in
the current directory and all subdirectories.
/E            Edit ACL instead of replacing it.
/C            Continue on access denied errors.
/G user:perm  Grant specified user access rights.
Perm can be: R  Read
W  Write
C  Change (write)
F  Full control
/R user       Revoke specified user’s access rights (only valid with /E).
/P user:perm  Replace specified user’s access rights.
Perm can be: N  None
R  Read
W  Write
C  Change (write)
F  Full control
/D user       Deny specified user access.
C:\Documents and Settings\sajith.kumar\sajithtest.txt MOGULUSINDIA\sajith.kumar:F
NT AUTHORITY\SYSTEM:F
BUILTIN\Administrators:F
Chkdsk         : Checks a disk and displays a status report.

CHKDSK [volume[[path]filename]]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]]
volume          Specifies the drive letter (followed by a colon),
mount point, or volume name.
filename        FAT/FAT32 only: Specifies the files to check for fragmentation.
/F              Fixes errors on the disk.
/V              On FAT/FAT32: Displays the full path and name of every file
on the disk.
On NTFS: Displays cleanup messages if any.
/R              Locates bad sectors and recovers readable information
(implies /F).
/L:size         NTFS only:  Changes the log file size to the specified number
of kilobytes.  If size is not specified, displays current
size.
/X              Forces the volume to dismount first if necessary.
All opened handles to the volume would then be invalid
(implies /F).
/I              NTFS only: Performs a less vigorous check of index entries.
/C              NTFS only: Skips checking of cycles within the folder
structure.
Eg    : chkdsk  c:
The type of the file system is NTFS.
Volume label is Local Disk.
WARNING!  F parameter not specified.
Running CHKDSK in read-only mode.
CHKDSK is verifying files (stage 1 of 3)…
89 percent completed.

Chkntfs        :Displays or modifies the checking of disk at boot time.

CHKNTFS volume […]
CHKNTFS /D
CHKNTFS /T[:time]
CHKNTFS /X volume […]
CHKNTFS /C volume […]

volume         Specifies the drive letter (followed by a colon),
mount point, or volume name.
/D             Restores the machine to the default behavior; all drives are
checked at boot time and chkdsk is run on those that are
dirty.
/T:time        Changes the AUTOCHK initiation countdown time to the
specified amount of time in seconds.  If time is not
specified, displays the current setting.
/X             Excludes a drive from the default boot-time check.  Excluded
drives are not accumulated between command invocations.
/C             Schedules a drive to be checked at boot time; chkdsk will run
if the drive is dirty.

If no switches are specified, CHKNTFS will display if the specified drive is
dirty or scheduled to be checked on next reboot.

Comp    : Compares the contents of two files or sets of files.

COMP [data1] [data2] [/D] [/A] [/L] [/N=number] [/C] [/OFF[LINE]]

data1      Specifies location and name(s) of first file(s) to compare.
data2      Specifies location and name(s) of second files to compare.
/D         Displays differences in decimal format.
/A         Displays differences in ASCII characters.
/L         Displays line numbers for differences.
/N=number  Compares only the first specified number of lines in each file.
/C         Disregards case of ASCII letters when comparing files.
/OFF[LINE] Do not skip files with offline attribute set.
Eg: comp

Compact    :Displays or alters the compression of files on NTFS partitions.

COMPACT [/C | /U] [/S[:dir]] [/A] [/I] [/F] [/Q] [filename […]]

/C        Compresses the specified files.  Directories will be marked
so that files added afterward will be compressed.
/U        Uncompresses the specified files.  Directories will be marked
so that files added afterward will not be compressed.
/S        Performs the specified operation on files in the given
directory and all subdirectories.  Default “dir” is the
current directory.
/A        Displays files with the hidden or system attributes.  These
files are omitted by default.
/I        Continues performing the specified operation even after errors
have occurred.  By default, COMPACT stops when an error is
encountered.
/F        Forces the compress operation on all specified files, even
those which are already compressed.  Already-compressed files
are skipped by default.
/Q        Reports only the most essential information.
filename  Specifies a pattern, file, or directory.

Used without parameters, COMPACT displays the compression state of
the current directory and any files it contains. You may use multiple
filenames and wildcards.  You must put spaces between multiple
parameters.

Convert        : Converts FAT volumes to NTFS.

CONVERT volume /FS:NTFS [/V] [/CvtArea:filename] [/NoSecurity] [/X]

volume      Specifies the drive letter (followed by a colon),
mount point, or volume name.
/FS:NTFS    Specifies that the volume is to be converted to NTFS.
/V          Specifies that Convert should be run in verbose mode.
/CvtArea:filename
Specifies a contiguous file in the root directory to be
the place holder for NTFS system files.
/NoSecurity Specifies the converted files and directories security
settings to be accessible by everyone.
/X          Forces the volume to dismount first if necessary.
All opened handles to the volume would then be invalid.
Eg : convert  C: /fs:ntfs
Find    : Searches for a text string in a file or files.

Copy     : Copies one or more files to another location.

COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B]
[+ source [/A | /B] [+ …]] [destination [/A | /B]]

source       Specifies the file or files to be copied.
/A           Indicates an ASCII text file.
/B           Indicates a binary file.
/D           Allow the destination file to be created decrypted
destination  Specifies the directory and/or filename for the new file(s).
/V           Verifies that new files are written correctly.
/N           Uses short filename, if available, when copying a file with
non-8dot3 name.
/Y           Suppresses prompting to confirm you want to overwrite an
existing destination file.
/-Y          Causes prompting to confirm you want to overwrite an
existing destination file.
/Z           Copies networked files in restartable mode.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.  Default is
to prompt on overwrites unless COPY command is being executed from
within a batch script.
Eg: C:\>copy c:\test2.txt  c:\test3.htm
1 file(s) copied.

Date    :Displays or sets the date.

DATE [/T | date]

Type DATE without parameters to display the current date setting and
a prompt for a new one.  Press ENTER to keep the same date.

If Command Extensions are enabled the DATE command supports
the /T switch which tells the command to just output the
current date, without prompting for a new date.

Dir    : Displays a list of files and subdirectories in a directory.

DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
[/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

[drive:][path][filename]
Specifies drive, directory, and/or files to list.

/A          Displays files with specified attributes.
attributes   D  Directories                R  Read-only files
H  Hidden files               A  Files ready for archiving
S  System files               –  Prefix meaning not
/B          Uses bare format (no heading information or summary).
/C          Display the thousand separator in file sizes.  This is the
default.  Use /-C to disable display of separator.
/D          Same as wide but files are list sorted by column.
/L          Uses lowercase.
/N          New long list format where filenames are on the far right.
/O          List by files in sorted order.
sortorder    N  By name (alphabetic)       S  By size (smallest first)
E  By extension (alphabetic)  D  By date/time (oldest first)
G  Group directories first    –  Prefix to reverse order
/P          Pauses after each screenful of information.
/Q          Display the owner of the file.
/S          Displays files in specified directory and all subdirectories.
/T          Controls which time field displayed or used for sorting
timefield   C  Creation
A  Last Access
W  Last Written
/W          Uses wide list format.
/X          This displays the short names generated for non-8dot3 file
names.  The format is that of /N with the short name inserted
before the long name. If no short name is present, blanks are
displayed in its place.
/4          Displays four-digit years

Switches may be preset in the DIRCMD environment variable.  Override
preset switches by prefixing any switch with – (hyphen)–for example, /-W.

Erase    :Deletes one or more files.

DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
ERASE [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names

names         Specifies a list of one or more files or directories.
Wildcards may be used to delete multiple files. If a
directory is specified, all files within the directory
will be deleted.

/P            Prompts for confirmation before deleting each file.
/F            Force deleting of read-only files.
/S            Delete specified files from all subdirectories.
/Q            Quiet mode, do not ask if ok to delete on global wildcard
/A            Selects files to delete based on attributes
attributes    R  Read-only files            S  System files
H  Hidden files               A  Files ready for archiving
–  Prefix meaning not

If Command Extensions are enabled DEL and ERASE change as follows:

The display semantics of the /S switch are reversed in that it shows
you only the files that are deleted, not the ones it could not find.

Fc     :Compares two files or sets of files and displays the differences between them

FC [/A] [/C] [/L] [/LBn] [/N] [/OFF[LINE]] [/T] [/U] [/W] [/nnnn]
[drive1:][path1]filename1 [drive2:][path2]filename2
FC /B [drive1:][path1]filename1 [drive2:][path2]filename2

/A         Displays only first and last lines for each set of differences.
/B         Performs a binary comparison.
/C         Disregards the case of letters.
/L         Compares files as ASCII text.
/LBn       Sets the maximum consecutive mismatches to the specified
number of lines.
/N         Displays the line numbers on an ASCII comparison.
/OFF[LINE] Do not skip files with offline attribute set.
/T         Does not expand tabs to spaces.
/U         Compare files as UNICODE text files.
/W         Compresses white space (tabs and spaces) for comparison.
/nnnn      Specifies the number of consecutive lines that must match
after a mismatch.
[drive1:][path1]filename1
Specifies the first file or set of files to compare.
[drive2:][path2]filename2
Specifies the second file or set of files to compare.
Eg:
C:\>fc /U c:\test1.txt c:\test2.txt
Comparing files C:\test1.txt and C:\TEST2.TXT
***** C:\test1.txt
?????
***** C:\TEST2.TXT
???
*****

C:\>fc /b c:\test1.txt c:\test2.txt
Comparing files C:\test1.txt and C:\TEST2.TXT
FC: C:\test1.txt longer than C:\TEST2.TXT
Find    : Searches for a text string in a file or files.
FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] “string” [[drive:][path]filename[ …]]

/V         Displays all lines NOT containing the specified string.
/C         Displays only the count of lines containing the string.
/N         Displays line numbers with the displayed lines.
/I         Ignores the case of characters when searching for the string.
/OFF[LINE] Do not skip files with offline attribute set.
“string”   Specifies the text string to find.
[drive:][path]filename
Specifies a file or files to search.

If a path is not specified, FIND searches the text typed at the prompt
or piped from another command.

Eg: C:\>find /V “g” c:/test2.txt

———- C:/TEST2.TXT
Abcdef

Findstr    : Searches for strings in files.

FINDSTR [/B] [/E] [/L] [/R] [/S] [/I] [/X] [/V] [/N] [/M] [/O] [/P] [/F:file]
[/C:string] [/G:file] [/D:dir list] [/A:color attributes] [/OFF[LINE]]
strings [[drive:][path]filename[ …]]

/B         Matches pattern if at the beginning of a line.
/E         Matches pattern if at the end of a line.
/L         Uses search strings literally.
/R         Uses search strings as regular expressions.
/S         Searches for matching files in the current directory and all
subdirectories.
/I         Specifies that the search is not to be case-sensitive.
/X         Prints lines that match exactly.
/V         Prints only lines that do not contain a match.
/N         Prints the line number before each line that matches.
/M         Prints only the filename if a file contains a match.
/O         Prints character offset before each matching line.
/P         Skip files with non-printable characters.
/OFF[LINE] Do not skip files with offline attribute set.
/A:attr    Specifies color attribute with two hex digits. See “color /?”
/F:file    Reads file list from the specified file(/ stands for console).
/C:string  Uses specified string as a literal search string.
/G:file    Gets search strings from the specified file(/ stands for console).
/D:dir     Search a semicolon delimited list of directories
strings    Text to be searched for.
[drive:][path]filename
Specifies a file or files to search.

Use spaces to separate multiple search strings unless the argument is prefixed
with /C.  For example, ‘FINDSTR “hello there” x.y’ searches for “hello” or
“there” in file x.y.  ‘FINDSTR /C:”hello there” x.y’ searches for
“hello there” in file x.y.

Regular expression quick reference:
.        Wildcard: any character
*        Repeat: zero or more occurances of previous character or class
^        Line position: beginning of line
$        Line position: end of line
[class]  Character class: any one character in set
[^class] Inverse class: any one character not in set
[x-y]    Range: any characters within the specified range
\x       Escape: literal use of metacharacter x
\<xyz    Word position: beginning of word
xyz\>    Word position: end of word

For full information on FINDSTR regular expressions refer to the online Command
Reference.

Format    : Formats a disk for use with Windows XP.

FORMAT volume [/FS:file-system] [/V:label] [/Q] [/A:size] [/C] [/X]
FORMAT volume [/V:label] [/Q] [/F:size]
FORMAT volume [/V:label] [/Q] [/T:tracks /N:sectors]
FORMAT volume [/V:label] [/Q]
FORMAT volume [/Q]

volume          Specifies the drive letter (followed by a colon),
mount point, or volume name.
/FS:filesystem  Specifies the type of the file system (FAT, FAT32, or NTFS).
/V:label        Specifies the volume label.
/Q              Performs a quick format.
/C              NTFS only: Files created on the new volume will be compressed
by default.
/X              Forces the volume to dismount first if necessary.  All opened
handles to the volume would no longer be valid.
/A:size         Overrides the default allocation unit size. Default settings
are strongly recommended for general use.
NTFS supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K.
FAT supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K,
(128K, 256K for sector size > 512 bytes).
FAT32 supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K,
(128K, 256K for sector size > 512 bytes).

Note that the FAT and FAT32 files systems impose the
following restrictions on the number of clusters on a volume:

FAT: Number of clusters <= 65526
FAT32: 65526 < Number of clusters < 4177918

Format will immediately stop processing if it decides that
the above requirements cannot be met using the specified
cluster size.

NTFS compression is not supported for allocation unit sizes
above 4096.

/F:size         Specifies the size of the floppy disk to format (1.44)
/T:tracks       Specifies the number of tracks per disk side.
/N:sectors      Specifies the number of sectors per track.

Ftype    : Displays or modifies file types used in file extension associations

FTYPE [fileType[=[openCommandString]]]

fileType  Specifies the file type to examine or change
openCommandString Specifies the open command to use when launching files
of this type.

Type FTYPE without parameters to display the current file types that
have open command strings defined.  FTYPE is invoked with just a file
type, it displays the current open command string for that file type.
Specify nothing for the open command string and the FTYPE command will
delete the open command string for the file type.  Within an open
command string %0 or %1 are substituted with the file name being
launched through the assocation.  %* gets all the parameters and %2
gets the 1st parameter, %3 the second, etc.  %~n gets all the remaining
parameters starting with the nth parameter, where n may be between 2 and 9,
inclusive.  For example:

ASSOC .pl=PerlScript
FTYPE PerlScript=perl.exe %1 %*

would allow you to invoke a Perl script as follows:

script.pl 1 2 3

If you want to eliminate the need to type the extensions, then do the
following:

set PATHEXT=.pl;%PATHEXT%

and the script could be invoked as follows:

script 1 2 3

eg: ftype
Wordpad.Document.1=”%ProgramFiles%\Windows NT\Accessories\WORDPAD.EXE” “%1″
WPLFile=”C:\Program Files\Windows Media Player\wmplayer.exe” /Open “%L”
wrifile=”C:\Program Files\Windows NT\Accessories\WORDPAD.EXE” “%1”
WSFFile=%SystemRoot%\System32\WScript.exe “%1” %*
WSHFile=%SystemRoot%\System32\WScript.exe “%1″ %*
WVXFile=”C:\Program Files\Windows Media Player\wmplayer.exe” /Open “%L”

Md    : Creates a directory.

MKDIR [drive:]path
MD [drive:]path

If Command Extensions are enabled MKDIR changes as follows:

MKDIR creates any intermediate directories in the path, if needed.
For example, assume \a does not exist then:

mkdir \a\b\c\d

Mode    :Configures system devices.

Serial port:       MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s]
[to=on|off] [xon=on|off] [odsr=on|off]
[octs=on|off] [dtr=on|off|hs]
[rts=on|off|hs|tg] [idsr=on|off]

Device Status:     MODE [device] [/STATUS]

Redirect printing: MODE LPTn[:]=COMm[:]

Select code page:  MODE CON[:] CP SELECT=yyy

Code page status:  MODE CON[:] CP [/STATUS]

Display mode:      MODE CON[:] [COLS=c] [LINES=n]

Typematic rate:    MODE CON[:] [RATE=r DELAY=d]

More    : Displays output one screen at a time.

MORE [/E [/C] [/P] [/S] [/Tn] [+n]] < [drive:][path]filename
command-name | MORE [/E [/C] [/P] [/S] [/Tn] [+n]]
MORE /E [/C] [/P] [/S] [/Tn] [+n] [files]

[drive:][path]filename  Specifies a file to display one
screen at a time.

command-name            Specifies a command whose output
will be displayed.

/E      Enable extended features
/C      Clear screen before displaying page
/P      Expand FormFeed characters
/S      Squeeze multiple blank lines into a single line
/Tn     Expand tabs to n spaces (default 8)

Switches can be present in the MORE environment
variable.

+n      Start displaying the first file at line n

files   List of files to be displayed. Files in the list
are separated by blanks.

If extended features are enabled, the following commands
are accepted at the — More — prompt:

P n     Display next n lines
S n     Skip next n lines
F       Display next file
Q       Quit
=       Show line number
?       Show help line
<space> Display next page
<ret>   Display next line

Move    : Moves files and renames files and directories.

To move one or more files:
MOVE [/Y | /-Y] [drive:][path]filename1[,…] destination

To rename a directory:
MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2

[drive:][path]filename1 Specifies the location and name of the file
or files you want to move.
destination             Specifies the new location of the file. Destination
can consist of a drive letter and colon, a
directory name, or a combination. If you are moving
only one file, you can also include a filename if
you want to rename the file when you move it.
[drive:][path]dirname1  Specifies the directory you want to rename.
dirname2                Specifies the new name of the directory.

/Y                      Suppresses prompting to confirm you want to
overwrite an existing destination file.
/-Y                     Causes prompting to confirm you want to overwrite
an existing destination file.

The switch /Y may be present in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.  Default is
to prompt on overwrites unless MOVE command is being executed from
within a batch script.
Eg: move test1.txt   test5.txt

Path    : Displays or sets a search path for executable files.

PATH [[drive:]path[;…][;%PATH%]
PATH ;

Type PATH ; to clear all search-path settings and direct cmd.exe to search
only in the current directory.
Type PATH without parameters to display the current path.
Including %PATH% in the new path setting causes the old path to be
appended to the new setting.

Rd     : Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

/S      Removes all directories and files in the specified directory
in addition to the directory itself.  Used to remove a directory
tree.

/Q      Quiet mode, do not ask if ok to remove a directory tree with /S

Ren    :Renames a file or files.

RENAME [drive:][path]filename1 filename2.
REN [drive:][path]filename1 filename2.
Note that you cannot specify a new drive or path for your destination file.
Rename  :ren  filename1 filename2

Replace        :Replaces files.

REPLACE [drive1:][path1]filename [drive2:][path2] [/A] [/P] [/R] [/W]
REPLACE [drive1:][path1]filename [drive2:][path2] [/P] [/R] [/S] [/W] [/U]

[drive1:][path1]filename Specifies the source file or files.
[drive2:][path2]         Specifies the directory where files are to be
replaced.
/A                       Adds new files to destination directory. Cannot
use with /S or /U switches.
/P                       Prompts for confirmation before replacing a file or
adding a source file.
/R                       Replaces read-only files as well as unprotected
files.
/S                       Replaces files in all subdirectories of the
destination directory. Cannot use with the /A
switch.
/W                       Waits for you to insert a disk before beginning.
/U                       Replaces (updates) only files that are older than
source files. Cannot use with the /A switch.

Set    : Displays, sets, or removes cmd.exe environment variables.

SET [variable=[string]]

variable  Specifies the environment-variable name.
string    Specifies a series of characters to assign to the variable.

Type SET without parameters to display the current environment variables.

Eg:
Path=C:\resourcekit\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Progr
am Files\QuickTime\QTSystem\;C:\Program Files\SSH Communications Security\SSH Secure
Shell
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 7, GenuineIntel
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=0407
ProgramFiles=C:\Program Files
PROMPT=$P$G

Start    : Starts a separate window to run a specified program or command.

START [“title”] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/WAIT] [/B] [command/program]
[parameters]

“title”     Title to display in  window title bar.
path        Starting directory
B           Start application without creating a new window. The
application has ^C handling ignored. Unless the application
enables ^C processing, ^Break is the only way to interrupt
the application
I           The new environment will be the original environment passed
to the cmd.exe and not the current environment.
MIN         Start window minimized
MAX         Start window maximized
SEPARATE    Start 16-bit Windows program in separate memory space
SHARED      Start 16-bit Windows program in shared memory space
LOW         Start application in the IDLE priority class
NORMAL      Start application in the NORMAL priority class
HIGH        Start application in the HIGH priority class
REALTIME    Start application in the REALTIME priority class
ABOVENORMAL Start application in the ABOVENORMAL priority class
BELOWNORMAL Start application in the BELOWNORMAL priority class
WAIT        Start application and wait for it to terminate
command/program

eg: start firefox http://www.yahoo.com http://www.google.com

Title     :Sets the window title for the command prompt window.

TITLE [string]

string       Specifies the title for the command prompt window.

Tree    : Folder PATH listing for volume Local Disk
Volume serial number is A4B2-2912
C:\?
Invalid path – \?
No subfolders exist

Eg:
│   ├───Favorites
│   │   ├───HEWLETT-PACKARD Recommended Sites
│   │   ├───Links
│   │   ├───Microsoft Websites
│   │   ├───netspeed

Type    : Displays the contents of a text file or files.

TYPE [drive:][path]filename
Eg: C:\>type c:\test1.txt
Abcdefghij

Ver    : Displays the Windows XP version.
Eg: C:\>ver
Microsoft Windows XP [Version 5.1.2600]

Volume        : Displays the disk volume label and serial number, if they exist.

VOL [drive:]

WINVER:     Displays the Windows XP version in a graphical mode

Xcopy    : Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
[/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
[/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z]
[/EXCLUDE:file1[+file2][+file3]…]

source       Specifies the file(s) to copy.
destination  Specifies the location and/or name of new files.
/A           Copies only files with the archive attribute set,
doesn’t change the attribute.
/M           Copies only files with the archive attribute set,
turns off the archive attribute.
/D:m-d-y     Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.
/EXCLUDE:file1[+file2][+file3]…
Specifies a list of files containing strings.  Each string
should be in a separate line in the files.  When any of the
strings match any part of the absolute path of the file to be
copied, that file will be excluded from being copied.  For
example, specifying a string like \obj\ or .obj will exclude
all files underneath the directory obj or all files with the
.obj extension respectively.
/P           Prompts you before creating each destination file.
/S           Copies directories and subdirectories except empty ones.
/E           Copies directories and subdirectories, including empty ones.
Same as /S /E. May be used to modify /T.
/V           Verifies each new file.
/W           Prompts you to press a key before copying.
/C           Continues copying even if errors occur.
/I           If destination does not exist and copying more than one file,
assumes that destination must be a directory.
/Q           Does not display file names while copying.
/F           Displays full source and destination file names while copying.
/L           Displays files that would be copied.
/G           Allows the copying of encrypted files to destination that does
not support encryption.
/H           Copies hidden and system files also.
/R           Overwrites read-only files.
/T           Creates directory structure, but does not copy files. Does not
include empty directories or subdirectories. /T /E includes
empty directories and subdirectories.
/U           Copies only files that already exist in destination.
/K           Copies attributes. Normal Xcopy will reset read-only attributes.
/N           Copies using the generated short names.
/O           Copies file ownership and ACL information.
/X           Copies file audit settings (implies /O).
/Y           Suppresses prompting to confirm you want to overwrite an
existing destination file.
/-Y          Causes prompting to confirm you want to overwrite an
existing destination file.
/Z           Copies networked files in restartable mode.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.

Eg: xcopy  /s   c:\testdir    d:\testdir

Advertisements

Posted on February 10, 2014, in Windows. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: