Вы находитесь на странице: 1из 20

Command Line Utilities Attrib

Displays, sets, or removes the read-only, archive, system, and hidden attributes assigned to files or directories. Used without parameters, attrib displays attributes of all files in the current directory.

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

Parameters
+r !ets the read-only file attribute. -r "lears the read-only file attribute. +a !ets the archive file attribute. -a "lears the archive file attribute. +s !ets the system file attribute. -s "lears the system file attribute. +h !ets the hidden file attribute. -h "lears the hidden file attribute. [Drive: [Path FileName !pecifies the location and name of the directory, file, or set of files for which you want to display or change attributes. #ou can use wildcard characters $that is, % and &' in the FileName parameter to display or change the attributes for a group of files. /s (pplies attrib and any command-line options to matching files in the current directory and all of its subdirectories. /d (pplies attrib and any command-line options to directories. /? Displays help at the command prompt.

Cmd
!tarts a new instance of the command interpreter, "md.e)e. Used without parameters, cmd displays the version and copyright information of the operating system.

Syntax
cmd [{/c | /k} [/s [/q [/d [{/a | /u} [/t:FG [/e:{on | o } [/ :{on | o } [/!:{on | o } [String

Parameters
/c "arries out the command specified by String and then stops. /k "arries out the command specified by String and continues. /s *odifies the treatment of String after /c or /k. /q +urns the echo off. /d Disables e)ecution of (uto,un commands. /a -ormats internal command output to a pipe or a file as (merican .ational !tandards /nstitute $(.!/'. /u -ormats internal command output to a pipe or a file as Unicode. /t:FG !ets the foreground F and bac0ground G colors. +he following tables lists valid he)adecimal digits that you can use as the values for F and G. "alue Color 1 2lac0 3 2lue 4 5reen 6 (7ua 8 ,ed 9 :urple ; #ellow < =hite > 5ray ? @ight blue ( @ight green 2 @ight a7ua

" D A /e:on /e:o

@ight red @ight purple @ight yellow 2right white

Anables command e)tensions. Disables commands e)tensions. / :on Anables file and directory name completion. / :o Disables file and directory name completion. /!:on Anables delayed environment variable e)pansion. /!:o Disables delayed environment variable e)pansion. String !pecifies the command you want to carry out. /? Displays help at the command prompt.

Co#y
"opies one or more files from one location to another.

Syntax
co#y [/d [/! [/n [{/y | /-y} [/$ [{/a | /b} Source [{/a | /b} [+ Source [{/a | /b} [+ ... [Destination [{/a | /b}

Parameters
/d (llows the encrypted files being copied to be saved as decrypted files at the destination. /! Berifies that new files are written correctly. /n Uses a short file name, if available, when copying a file with a name longer than eight characters, or with a file e)tension longer than three characters. /y !uppresses prompting to confirm that you want to overwrite an e)isting destination file.

/-y :rompts you to confirm that you want to overwrite an e)isting destination file. /$ "opies networ0ed files in restartable mode. /a /ndicates an (!"// te)t file. /b /ndicates a binary file. Source ,e7uired. !pecifies the location from which you want to copy a file or set of files. Source can consist of a drive letter and colon, a folder name, a file name, or a combination of these. Destination ,e7uired. !pecifies the location to which you want to copy a file or set of files. Destination can consist of a drive letter and colon, a folder name, a file name, or a combination of these. /? Displays help at the command prompt.

%e ra&
@ocates and consolidates fragmented boot files, data files, and folders on local volumes.

Syntax
de ra& Volume de ra& Volume [/a de ra& Volume [/a [/! de ra& Volume [/! de ra& Volume [/

Parameters
Volume +he drive letter or a mount point of the volume to be defragmented. /a (nalyCes the volume, displays a summary of the analysis report, and indicates whether you should defragment the volume. /!

Displays the complete analysis and defragmentation reports. =hen used in combination with /a, displays only the analysis report. =hen used alone, displays both the analysis and defragmentation reports. / -orces defragmentation of the volume when free space is low. /? Displays help at the command prompt.

%el 'erase(
Deletes specified files.

Syntax
del [Drive: [Path FileName [ ... [/# [/ [/s [/q [/a[:Attributes erase [Drive: [Path FileName [ ... [/# [/ [/s [/q [/a[:Attributes

Parameters
[Drive: [Path FileName !pecifies the location and name of the file or set of files you want to delete. FileName is re7uired. #ou can use multiple file names. !eparate file names with spaces, commas, or semicolons. /# :rompts you for confirmation before deleting the specified file. / -orces deletion of read-only files. /s Deletes specified files from the current directory and all subdirectories. Displays the names of the files as they are being deleted. /q !pecifies 7uiet mode. #ou are not prompted for delete confirmation. /a Deletes files based on specified attributes. Attributes !pecifies any of the file attributes listed in the following table. Attribute %escri#tion r ,ead-only a (rchive s !ystem h Didden :refi) that means .E+

/? Displays help at the command prompt.

)ename 'ren(
"hanges the name of a file or a set of files.

Syntax
rename [Drive: [Path FileName1 FileName2 ren [Drive: [Path FileName1 FileName2

Parameters
[Drive: [Path FileName1 !pecifies the location and name of the file or set of files you want to rename. FileName2 !pecifies the new name for the file. /f you use wildcards $& and %', FileName2 specifies the new names for the files. #ou cannot specify a new drive or path when renaming files. /? Displays help at the command prompt.

%eltree
Deletes a directory and all the subdirectories and files in it. +o delete one or more files and directoriesF DA@+,AA [G# [driveF path [[driveF path[... G# !uppresses prompting to confirm you want to delete the subdirectory. [driveF path !pecifies the name of the directory you want to delete. .oteF Use DA@+,AA cautiously. Avery file and subdirectory within the specified directory will be deleted.

%ir

Displays a list of a directoryHs files and subdirectories. Used without parameters, dir displays the dis0Hs volume label and serial number, followed by a list of directories and files on the dis0, including their names and the date and time each was last modified. -or files, dir displays the name e)tension and the siCe in bytes. %ir also displays the total number of files and directories listed, their cumulative siCe, and the free space $in bytes' remaining on the dis0.

Syntax
dir [Drive: [Path [FileName [... [/# [/q [/* [/d [/a[[: Attributes [/o[[: SortOrder [/t[[: TimeField [/s [/b [/l [/n [/x [/c [/+

Parameters
[Drive: [Path !pecifies the drive and directory for which you want to see a listing. [FileName !pecifies a particular file or group of files for which you want to see a listing. /# Displays one screen of the listing at a time. +o see the ne)t screen, press any 0ey on the 0eyboard. /q Displays file ownership information. /* Displays the listing in wide format, with as many as five file names or directory names on each line. /d !ame as /* but files are sorted by column. /a [[: Attributes Displays only the names of those directories and files with the attributes you specify. /f you omit /a, dir displays the names of all files e)cept hidden and system files. /f you use /a without specifying Attributes, dir displays the names of all files, including hidden and system files. +he following list describes each of the values you can use for Attributes. +he colon $F' is optional. Use any combination of these values, and do not separate the values with spaces. "alue %escri#tion h Didden files s !ystem files d Directories a -iles ready for archiving r ,ead-only files -h -iles that are not hidden -s -iles other than system files -d -iles only $not directories'

-a -iles that have not changed since the last bac0up -r -iles that are not read-only /o [[: SortOrder "ontrols the order in which dir sorts and displays directory names and file names. /f you omit /o, dir displays the names in the order in which they occur in the directory. /f you use /o without specifying SortOrder, dir displays the names of the directories, sorted in alphabetic order, and then displays the names of files, sorted in alphabetic order. +he colon $F' is optional. +he following list describes each of the values you can use for SortOrder. Use any combination of the values, and do not separate these values with white spaces. "alue %escri#tion n /n alphabetic order by name e /n alphabetic order by e)tension d 2y date and time, earliest first s 2y siCe, smallest first & =ith directories grouped before files -n /n reverse alphabetic order by name $I through (' -e /n reverse alphabetic order by e)tension $.III through .(((' -d 2y date and time, latest first -s 2y siCe, largest first -& =ith directories grouped after files /t [[: TimeField !pecifies which time field to display or use for sorting. +he following list describes each of the values you can use for TimeField. "alue %escri#tion c "reation a @ast access * @ast written /s @ists every occurrence, in the specified directory and all subdirectories, of the specified file name. /b @ists each directory name or file name, one per line, including the file name e)tension. /b does not display heading information or a summary. /b overrides /*. /l Displays unsorted directory names and file names in lowercase. /l does not convert e)tended characters to lowercase. /n Displays a long list format with file names on the far right of the screen. /x Displays the short names generated for files on .+-! and -(+ volumes. +he display is the same as the display for /n, but short names are displayed after the long name. /c Displays the thousand separator in file siCes.

/+ Displays four-digit year format. /? Displays help at the command prompt.

,cho
+urns the command echoing feature on or off, or displays a message. Used without parameters, echo displays the current echo setting.

Syntax
echo [{on | o } [Message

Parameters
{on | o } !pecifies whether to turn the command echoing feature on or off. Message !pecifies the te)t that you want to display on the screen. /? Displays help at the command prompt.

,dit
AD/+ [G2 [GD [G, [G! [GJnnnK [G% [file$s' G2 - -orces monochrome mode. GD - Displays the ma)imum number of lines possible for your hardware. G, - @oad file$s' in read-only mode. G! - -orces the use of short filenames. GJnnnK - @oad binary file$s', wrapping lines to JnnnK characters wide. G% - Displays this help screen. [file - !pecifies initial files$s' to load. =ildcards and multiple filespecs can be given.

-disk
"onfigures a hard dis0 for use with *!-DE!. $.ot available for =indows 4111GL:G4116'

-D/!M [G!+(+U! GL G!+(+U! Displays partition information. GL /gnores e)tended dis0-access support. Use this switch if you receive dis0 access or stac0 overflow messages.

-ormat
-ormats the dis0 in the specified volume to accept =indows files.

Syntax
ormat Volume [/ s:FileSystem [/!: abel [/q [/a:!nitSi"e [/c [/x ormat Volume [/!: abel [/q [/ :Si"e ormat Volume [/!: abel [/q [/t:Trac#s /n:Sectors ormat Volume [/!: abel [/q ormat Volume [/q ormat Bolume [Gs

Parameters
Volume !pecifies the mount point, volume name, or drive letter $followed by a colon', of the drive you want to format. /f you do not specify any of the following command-line options, ormat uses the volume type to determine the default format for the dis0. / s:FileSystem !pecifies the file system to use file allocation table $-(+', -(+64, or .+-!. -loppy dis0s can use only the -(+ file system. /!: abel !pecifies the volume label. /f you omit the /! command-line option or use it without specifying a volume label, ormat prompts you for the volume label after the formatting is completed. Use the synta) /!: to prevent the prompt for a volume label. /f you format more than one dis0 by using one ormat command, all of the dis0s will be given the same volume label. -or more information about dis0 volume labels, see ,elated +opics. /a:!nitSi"e

!pecifies the allocation unit siCe to use on -(+, -(+64, or .+-! volumes. /f you do not specify !nitSi"e, it is chosen based on volume siCe. +he following table lists valid values for !nitSi"e. "alue %escri#tion ./0 "reates 934 bytes per cluster. /10+ "reates 3148 bytes per cluster. 01+2 "reates 418> bytes per cluster. +134 "reates 81?; bytes per cluster. 2/30 "reates >3?4 bytes per cluster. /45 "reates 3; 0ilobytes per cluster. 605 "reates 64 0ilobytes per cluster. 4+5 "reates ;8 0ilobytes per cluster. /q :erforms a 7uic0 format. Deletes the file table and the root directory of a previously formatted volume but does not perform a sector by sector scan for bad areas. #ou should use the /q command-line option to format only previously formatted volumes that you 0now are in good condition. / :Si"e !pecifies the siCe of the floppy dis0 to format. =hen possible, use this commandline option instead of the /t and /n command-line options. =indows accepts the following value for siCeF /++1 or /++1k or /++1kb or /7++ or /7++m or /7++mb 3.88-*2, double-sided, 7uadruple-density, 6.9-inch dis0 /t:Trac#s !pecifies the number of trac0s on the dis0. =hen possible, use the / commandline option instead of this command-line option. /f you use the /t command-line option, you must also use the /n command-line option. +hese two command-line options provide an alternative method of specifying the siCe of the dis0 being formatted. #ou cannot use the / command-line option with the /t command-line option. /n:Sectors !pecifies the number of sectors per trac0. =hen possible, use the / command-line option instead of this command-line option. /f you use the /n command-line option, you must also use the /t command-line option. +hese two command-line options provide an alternative method of specifying the siCe of the dis0 being formatted. #ou cannot use the / command-line option with the /n command-line option. /c .+-! only. -iles created on the new volume will be compressed by default. /x "auses the volume to dismount, if necessary, before it is formatted. (ny open handles to the volume will no longer be valid.

Gs "opies system files to the formatted dis0. $=indows ?) only'

8%/C%/)% 8kdir '8%(


"reates a directory or subdirectory.

Syntax
mkdir [Drive: Path md [Drive: Path

Parameters
Drive: !pecifies the drive on which you want to create the new directory. Path ,e7uired. !pecifies the name and location of the new directory. +he ma)imum length of any single path is determined by the file system. /? Displays help at the command prompt. Displays the name of or changes the current directory.

C9%:) 'C%(
"DD/, [GD [driveF [path "DD/, [.. "D [GD [driveF [path "D [.. .. !pecifies that you want to change to the parent directory. +ype "D driveF to display the current directory in the specified drive. +ype "D without parameters to display the current drive and directory. Use the GD switch to change current drive in addition to changing current directory for a drive.

/f "ommand A)tensions are enabled "DD/, changes as followsF +he current directory string is converted to use the same case as the on dis0 names. !o "D "FN+A*: would actually set the current directory to "FN+emp if that is the case on dis0. "DD/, command does not treat spaces as delimiters, so it is possible to "D into a subdirectory name that contains a space without surrounding the name with 7uotes. -or e)ampleF cd NwinntNprofilesNusernameNprogramsNstart menu is the same asF cd ONwinntNprofilesNusernameNprogramsNstart menuO which is what you would have to type if e)tensions were disabled.

)mdir 'rd(
,emoves $that is, deletes' a directory.

Syntax
rmdir [Drive: Path [/s [/q rd [Drive: Path [/s [/q

Parameters
[Drive: Path !pecifies the location and name of the directory that you want to delete. /s ,emoves the specified directory and all subdirectories including any files. Use /s to remove a tree. /q ,uns rmdir in 7uiet mode. Deletes directories without confirmation. /? Displays help at the command prompt.

8,8

Displays the amount of used and free memory in your system. *A* [G:,E5,(* | GDA2U5 | G"@(!!/-# G:,E5,(* or G: Displays status of programs currently loaded in memory. GDA2U5 or GD Displays status of programs, internal drivers, and other information. G"@(!!/-# or G" "lassifies programs by memory usage. @ists the siCe of programs, provides a summary of memory in use, and lists largest memory bloc0 available.

Pin&
Berifies /:-level connectivity to another +":G/: computer by sending /nternet "ontrol *essage :rotocol $/"*:' Acho ,e7uest messages. +he receipt of corresponding Acho ,eply messages are displayed, along with round-trip times. :ing is the primary +":G/: command used to troubleshoot connectivity, reachability, and name resolution. Used without parameters, #in& displays help.

Syntax
#in& [-t [-a [-n $ount [-l Si"e [- [-i TT [-! TOS [-r $ount [-s $ount [{-; %ost ist | -k %ost ist} [-* Timeout [-) [-S SrcAddr [-+ [-4 TargetName

Parameters
-t !pecifies that ping continue sending Acho ,e7uest messages to the destination until interrupted. +o interrupt and display statistics, press "+,@P2,A(M. +o interrupt and 7uit ping, press "+,@P". -a !pecifies that reverse name resolution is performed on the destination /: address. /f this is successful, ping displays the corresponding host name. -n $ount !pecifies the number of Acho ,e7uest messages sent. +he default is 8. -l Si"e !pecifies the length, in bytes, of the Data field in the Acho ,e7uest messages sent. +he default is 64. +he ma)imum Si"e is ;9,94<. !pecifies that Acho ,e7uest messages are sent with the DonHt -ragment flag in the /: header set to 3 $available on /:v8 only'. +he Acho ,e7uest message cannot be fragmented by routers in the path to the destination. +his parameter is useful for troubleshooting path *a)imum +ransmission Unit $:*+U' problems. -i TT

!pecifies the value of the ++@ field in the /: header for Acho ,e7uest messages sent. +he default is the default ++@ value for the host. +he ma)imum TT is 499. -! TOS !pecifies the value of the +ype of !ervice $+E!' field in the /: header for Acho ,e7uest messages sent $available on /:v8 only'. +he default is 1. TOS is specified as a decimal value from 1 through 499. -r $ount !pecifies that the ,ecord ,oute option in the /: header is used to record the path ta0en by the Acho ,e7uest message and corresponding Acho ,eply message $available on /:v8 only'. Aach hop in the path uses an entry in the ,ecord ,oute option. /f possible, specify a $ount that is e7ual to or greater than the number of hops between the source and destination. +he $ount must be a minimum of 3 and a ma)imum of ?. -s $ount !pecifies that the /nternet +imestamp option in the /: header is used to record the time of arrival for the Acho ,e7uest message and corresponding Acho ,eply message for each hop. +he $ount must be a minimum of 3 and a ma)imum of 8. +his is re7uired for lin0-local destination addresses. -; %ost ist !pecifies that the Acho ,e7uest messages use the @oose !ource ,oute option in the /: header with the set of intermediate destinations specified in %ost ist $available on /:v8 only'. =ith loose source routing, successive intermediate destinations can be separated by one or multiple routers. +he ma)imum number of addresses or names in the host list is ?. +he host list is a series of /: addresses $in dotted decimal notation' separated by spaces. -k %ost ist !pecifies that the Acho ,e7uest messages use the !trict !ource ,oute option in the /: header with the set of intermediate destinations specified in %ost ist $available on /:v8 only'. =ith strict source routing, the ne)t intermediate destination must be directly reachable $it must be a neighbor on an interface of the router'. +he ma)imum number of addresses or names in the host list is ?. +he host list is a series of /: addresses $in dotted decimal notation' separated by spaces. -* Timeout !pecifies the amount of time, in milliseconds, to wait for the Acho ,eply message that corresponds to a given Acho ,e7uest message to be received. /f the Acho ,eply message is not received within the time-out, the O,e7uest timed outO error message is displayed. +he default time-out is 8111 $8 seconds'. -) !pecifies that the round-trip path is traced $available on /:v; only'. -S SrcAddr !pecifies the source address to use $available on /:v; only'. -+ !pecifies that /:v8 is used to ping. +his parameter is not re7uired to identify the target host with an /:v8 address. /t is only re7uired to identify the target host by name. -4

!pecifies that /:v; is used to ping. +his parameter is not re7uired to identify the target host with an /:v; address. /t is only re7uired to identify the target host by name. TargetName !pecifies the host name or /: address of the destination. /? Displays help at the command prompt.

SCA<%:S5
=indows ?) utility to scan for file, folder, and physical dis0 errors. -or =indows .+G4111GL:G4116 use "DMD!M.

SCA<),=
!cans and bac0s up ,egistry for =indows ?>G*A UsageF !"(.,A5 [GJoptionK JoptionK % F Displays usage. 2("MU: F 2ac0up the registry and related system configuration files. ,A!+E,A F "hoose a bac0up to restore. -/L F ,epair the registry. "E**A.+QOJcommentKO F (dds the specified comment to the "(2 file while bac0ing up.

Set
Displays, sets, or removes environment variables. Used without parameters, set displays the current environment settings.

Syntax
set [[/a [&'(ression [/# [Variable> String

Parameters
/a !ets String to a numerical e)pression that is evaluated.

/# !ets the value of Variable to a line of input. Variable !pecifies the variable you want to set or modify. String !pecifies the string you want to associate with the specified variable. /? Displays help at the command prompt.

Set!er
!ets the *!-DE! version number that =indows reports to a program. Display current version tableF !A+BA, [driveFpath (dd entryF !A+BA, [driveFpath filename n.nn Delete entryF !A+BA, [driveFpath filename GDA@A+A [GRU/A+ [driveFpath !pecifies location of the !A+BA,.ALA file. filename !pecifies the filename of the program. n.nn !pecifies the *!-DE! version to be reported to the program. GDA@A+A or GD Deletes the version-table entry for the specified program. GRU/A+ or GR Dides the message typically displayed during deletion of version-table entry.

?y#e
Displays the contents of a te)t file. Use the ty#e command to view a te)t file without modifying it.

Syntax
ty#e [Drive: [Path FileName

Parameters
[Drive: [Path FileName !pecifies the location and name of the file or files that you want to view. !eparate multiple file names with spaces. /? Displays help at the command prompt.

"er
Displays the operating system version number.

@co#y
"opies files and directories, including subdirectories.

Syntax
xco#y Source [Destination [/* [/# [/c [/! [/q [/ [/l [/& [/d[:MM)DD)**** [/u [/i [/s [/e [/t [/k [/r [/h [{/a | /m} [/n [/o [/x [/exclude:FileName1[+[FileName2 [+[FileName+ [{/y | /-y} [/$

Parameters
Source ,e7uired. !pecifies the location and names of the files you want to copy. +his parameter must include either a drive or a path. Destination !pecifies the destination of the files you want to copy. +his parameter can include a drive letter and colon, a directory name, a file name, or a combination of these. /* Displays the following message and waits for your response before starting to copy filesF
Press any key to begin copying file(s)

/# :rompts you to confirm whether you want to create each destination file. /c /gnores errors. /! Berifies each file as it is written to the destination file to ma0e sure that the destination files are identical to the source files. /q !uppresses the display of xco#y messages. / Displays source and destination file names while copying. /l Displays a list of files that are to be copied. /& "reates decrypted destination files. /d[:MM)DD)****

"opies source files changed on or after the specified date only. /f you do not include a MM)DD)**** value, xco#y copies all Source files that are newer than e)isting Destination files. +his command-line option allows you to update files that have changed. /u "opies files from Source that e)ist on Destination only. /i /f Source is a directory or contains wildcards and Destination does not e)ist, xco#y assumes,destination specifies a directory name and creates a new directory. +hen, xco#y copies all specified files into the new directory. 2y default, xco#y prompts you to specify whether Destination is a file or a directory. /s "opies directories and subdirectories, unless they are empty. /f you omit /s, xco#y wor0s within a single directory. /e "opies all subdirectories, even if they are empty. Use /e with the /s and /t command-line options. /t "opies the subdirectory structure $that is, the tree' only, not files. +o copy empty directories, you must include the /e command-line option. /k "opies files and retains the read-only attribute on destination files if present on the source files. 2y default, xco#y removes the read-only attribute. /r "opies read-only files. /h "opies files with hidden and system file attributes. 2y default, xco#y does not copy hidden or system files. /a "opies only source files that have their archive file attributes set. /a does not modify the archive file attribute of the source file. -or information about how to set the archive file attribute by using attrib, see ,elated +opics. /m "opies source files that have their archive file attributes set. Unli0e /a, /m turns off archive file attributes in the files that are specified in the source. -or information about how to set the archive file attribute by using attrib, see ,elated +opics. /n "reates copies by using the .+-! short file or directory names. /n is re7uired when you copy files or directories from an .+-! volume to a -(+ volume or when the -(+ file system naming convention $that is, >.6 characters' is re7uired on the destination file system. +he destination file system can be -(+ or .+-!. /o "opies file ownership and discretionary access control list $D("@' information. /x

"opies file audit settings and system access control list $!("@' information $implies /o'. /exclude:FileName1[+[FileName2 [+[FileName+ !pecifies a list of files containing strings. /y !uppresses prompting to confirm that you want to overwrite an e)isting destination file. /-y :rompts to confirm that you want to overwrite an e)isting destination file. /$ "opies over a networ0 in restartable mode. /? Displays help at the command prompt.

Вам также может понравиться