How To Start Dos
1. Go to Start Click Run.
2.Type Cmd On Run and press Enter.
Dos Will start.
Dos Commands
1. Assoc :-
with the help of this command you can change file type through their extension.
syntax:-ASSOC .ext=filetype
example:- assoc .xls=txtfile
here your excel file type will convert on text file and all excel file will open on notepad
2.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.
/S Processes files in all directories in the specified path.
/D Process folders as well.
3.Break :-
Break can be used to enable or disable the breaking capability of the computer. For example, if a user wanted to cancel a batch file or another MS-DOS processes, that user could press CTRL + C (break), which would then prompt the user if they wish to cancel the current process.
Turning break off will cancel CTRL + C; however, the user will still be able to press CTRL + PAUSE/BREAK and have the capability of getting out of a batch file or current running process.
Note: Newer versions of Windows (Windows ME, Windows 2000, Windows XP, and higher) only include this command for backwards compatibility and turning the break off has no effect.
BREAK [ON | OFF]
Type BREAK without a parameter to display the current BREAK setting.
4. BCDEDIT :-
Bcdedit is a really powerful tool that Windows Vista and Windows 7 uses to manage the boot loader entries.
BCDEDIT needs a boot loader file to boot your system.
A boot loader is a file that contains necessary information that instruct the system how to boot/start an operating system.
Windows 7 and Vista bootloader file is \bootmgr
Windows XP bootloader file is \ntldrBCDEDIT can support other bootloaders too, like grub for linux. You just have to place the bootloader file on the root of the boot manager partition. e.g. \grldr and you have a grub boot loader enabled.
Bcdedit edits a file called bcd , which is located in Windows 7's hidden partition under \boot\bcd.
In Vista, its located under C:\boot\bcd.
A boot entry consists of 4 main elements:
1. Identifier
The identifier is how the system has named the boot entry.
2. Device
The device is the drive or virtual image that the system will use to boot the boot entry.
3. Path
The path is the location on the device where the bootloader file is found.
4. Description
The description is the friendly name we give to our boot entry, e.g. "Windows 7"
Warning
IMPORTANT: make a backup of your bcd file first. To do that, type:
bcdedit /export C:\SAVEDBCD
This will create a file c:\savebcd which is your boot entry backup.
If you mess up, you can always undo changes by:
bcdedit /import c:\savedbcd
5.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.
Wildcards can be used to specify more that one file in a command. You can specify more than one user in a command.
Examples
cacls computerhelper777.txt
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.
Wildcards can be used to specify more that one file in a command. You can specify more than one user in a command.
Examples
cacls computerhelper777.txt
6. CALL :-
Calls one batch program from another.
CALL [drive:][path]filename [batch-parameters]
If Command Extensions are enabled, CALL changes as follows:
CALL command now accepts labels as the target of the CALL. The syntax is:
CALL :label arguments
A new batch file context is created with the specified arguments and control is passed to the statement after the label specified. You must "exit" twice by reaching the end of the batch script file twice. The first time you read the end, control will return to just after the CALL statement. The second time will exit the batch script. Type GOTO /? for a description of the GOTO :EOF extension that will allow you to "return" from a batch script.
In addition, expansion of batch script argument references (%0, %1, etc.) have been changed as follows:
%* in a batch script refers to all the arguments (e.g. %1 %2 %3 %4 %5 ...)
Substitution of batch parameters (%n) has been enhanced. You can now use the below optional syntax:
%~1 expands %1 removing any surrounding quotes (")
%~f1 expands %1 to a fully qualified path name
%~d1 expands %1 to a drive letter only
%~p1 expands %1 to a path only
%~n1 expands %1 to a file name only
%~x1 expands %1 to a file extension only
%~s1 expanded path contains short names only
%~a1 expands %1 to file attributes
%~t1 expands %1 to date/time of file
%~z1 expands %1 to size of file
%~$PATH:1 searches the directories listed in the PATH
environment variable and expands %1 to the fully
qualified name of the first one found. If the
environment variable name is not defined or the
file is not found by the search, then this
modifier expands to the empty string
The modifiers can be combined to get compound results:
%~dp1 expands %1 to a drive letter and path only
%~nx1 expands %1 to a file name and extension only
%~dp$PATH:1 searches the directories listed in the PATH
environment variable for %1 and expands to the
drive letter and path of the first one found.
%~ftza1 expands %1 to a DIR-like output line
In the above examples, %1 and PATH can be replaced by other valid values. The %~ syntax is terminated by a valid argument number. The %~ modifiers may not be used with %*
Examples
call computerhelper777.bat
7.CD :-
Type CD drive: to display the current directory in the specified drive.Type CD without parameters to display the current drive and directory.
CHDIR [/D] [drive:][path]
CHDIR [..]
CD [/D] [drive:][path]
CD [..]
.. Specifies that you want to change to the parent directory.
Use the /D switch to change current drive in addition to changing current directory for a drive.
If Command Extensions are enabled CHDIR changes as follows:
The current directory string is converted to use the same case as the on disk names. So CD C:\TEMP would actually set the current directory to C:\Temp if that is the case on disk.
CHDIR command does not treat spaces as delimiters, so it is possible to CD into a subdirectory name that contains a space without surrounding the name with quotes. For example:
cd \winnt\profiles\username\programs\start menu
is the same as:
cd "\winnt\profiles\username\programs\start menu"
which is what you would have to type if extensions were disabled.
8.CHCP :-
Displays or sets the active code page number.CHCP [nnn]
nnn Specifies a code page number.
Type CHCP without a parameter to display the active code page number.
Examples
chcp
Display the page number.
chcp 447
Sets the active page to 437.
chcp
Display the page number.
chcp 447
Sets the active page to 437.
9.CHDIR :-
CHDIR [drive:][path]
CHDIR[..]
CD [drive:][path]
CD[..]
Examples
chdir\
Goes to the highest level, the root of the drive.
chdir..
Goes back one directory. For example, if you are within the C:\Windows\COMMAND> directory, this would take you to C:\Windows>
Windows 95, Windows 98 and later versions of windows allow you to go back more than one directory by using three or more dots. For example, typing chdir... with three dots after the cd would take you back two directories.
chdir windows.
10.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 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.
/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.
The /I or /C switch reduces the amount of time required to run Chkdsk by skipping certain checks of the volume.
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 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.
/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.
The /I or /C switch reduces the amount of time required to run Chkdsk by skipping certain checks of the volume.
11.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 count down 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.
11.CLS :-
Clears the screen.
CLS
12.CMD :-
CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF] [[/S] [/C | /K] string]
/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
/S Modifies the treatment of string after /C or /K (see below)
/Q Turns echo off
/D Disable execution of AutoRun commands from registry (see below)
/A Causes the output of internal commands to a pipe or file to be ANSI
/U Causes the output of internal commands to a pipe or file to be Unicode
/T:fg Sets the foreground/background colors (see COLOR /? for more info)
/E:ON Enable command extensions (see below)
/E:OFF Disable command extensions (see below)
/F:ON Enable file and directory name completion characters (see below)
/F:OFF Disable file and directory name completion characters (see below)
/V:ON Enable delayed environment variable expansion using c as the delimiter. For example, /V:ON would allow !var! to expand the variable var at execution time. The var syntax expands variables at input time, which is quite a different thing when inside of a FOR loop.
/V:OFF Disable delayed environment expansion.
Note that multiple commands separated by the command separator '&&' are accepted for string if surrounded by quotes. Also, for compatibility reasons, /X is the same as /E:ON, /Y is the same as /E:OFF and /R is the same as /C. Any other switches are ignored.
If /C or /K is specified, then the remainder of the command line after the switch is processed as a command line, where the following logic is used to process quote (") characters:
1. If all of the following conditions are met, then quote characters on the command line are preserved:
- no /S switch
- exactly two quote characters
- no special characters between the two quote characters, where special is one of: &<>()@^|
- there are one or more whitespace characters between the two quote characters
- the string between the two quote characters is the name of an executable file.
2. Otherwise, old behavior is to see if the first character is a quote character and if so, strip the leading character and remove the last quote character on the command line, preserving any text after the last quote character.
If /D was NOT specified on the command line, then when CMD.EXE starts, it looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if either or both are present, they are executed first.
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
or
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
Command Extensions are enabled by default. You may also disable extensions for a particular invocation by using the /E:OFF switch. You can enable or disable extensions for all invocations of CMD.EXE on a machine or user logon session by setting either or both of the following REG_DWORD values in the registry using REGEDT32.EXE:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions
or
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions
to either 0x1 or 0x0. The user specific setting takes precedence over the machine setting. The command line switches take precedence over the registry settings.
The command extensions involve changes or additions to the below commands.
DEL or ERASE
COLOR
CD or CHDIR
MD or MKDIR
PROMPT
PUSHD
POPD
SET
SETLOCAL
ENDLOCAL
IF
FOR
CALL
SHIFT
GOTO
START (also includes changes to external command invocation)
ASSOC
FType
To get specific details, type commandname /? to view the specifics.
Delayed environment variable expansion is NOT enabled by default. You can enable or disable delayed environment variable expansion for a particular invocation of CMD.EXE with the /V:ON or /V:OFF switch. You can enable or disable completion for all invocations of CMD.EXE on a machine or user logon session by setting either or both of the following REG_DWORD values in the registry using REGEDT32.EXE:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\DelayedExpansion
or
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\DelayedExpansion
to either 0x1 or 0x0. The user specific setting takes precedence over the machine setting. The command line switches take precedence over the registry settings.
If delayed environment variable expansion is enabled, then the exclamation character can be used to substitute the value of an environment variable at execution time.
File and Directory name completion is NOT enabled by default. You can enable or disable file name completion for a particular invocation of CMD.EXE with the /F:ON or /F:OFF switch. You can enable or disable completion for all invocations of CMD.EXE on a machine or user logon session by setting either or both of the following REG_DWORD values in the registry using REGEDT32.EXE:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\CompletionChar
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\PathCompletionChar
or
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\PathCompletionChar
with the hex value of a control character to use for a particular function (e.g. 0x4 is Ctrl-D and 0x6 is Ctrl-F). The user specific settings take precedence over the machine settings. The command line switches take precedence over the registry settings.
If completion is enabled with the /F:ON switch, the two control characters used are Ctrl-D for directory name completion and Ctrl-F for file name completion. To disable a particular completion character in the registry, use the value for space (0x20) as it is not a valid control character.
Completion is invoked when you type either of the two control characters. The completion function takes the path string to the left of the cursor appends a wild card character to it if none is already present and builds up a list of paths that match. It then displays the first matching path. If no paths match, it just beeps and leaves the display alone. Thereafter, repeated pressing of the same control character will cycle through the list of matching paths. Pressing the Shift key with the control character will move through the list backwards. If you edit the line in any way and press the control character again, the saved list of matching paths is discarded and a new one generated. The same occurs if you switch between file and directory name completion. The only difference between the two control characters is the file completion character matches both file and directory names, while the directory completion character only matches directory names. If file completion is used on any of the built in directory commands (CD, MD or RD) then directory completion is assumed.
The completion code deals correctly with file names that contain spaces or other special characters by placing quotes around the matching path. Also, if you backup, then invoke completion from within a line, the text to the right of the cursor at the point completion was invoked is discarded.
The special characters that require quotes are:
<space>
&()[]{}^=;!'+,`~
13.COLOR:-
Sets the default console foreground and background colors.COLOR [attr]
attr Specifies color attribute of console output
Color attributes are specified by TWO hex digits -- the first corresponds to the background; the second the foreground. Each digit can be any of the below values.
0 = Black 8 = Gray
1 = Blue 9 = Light Blue
2 = Green A = Light Green
3 = Aqua B = Light Aqua
4 = Red C = Light Red
5 = Purple D = Light Purple
6 = Yellow E = Light Yellow
7 = White F = Bright White
14. COMP :-
Compares the contents of two files or sets of files.
COMP [data1] [data2] [/D] [/A] [/L] [/N=number] [/C]
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.
To compare sets of files, use wildcards in data1 and data2 parameters.
15. 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 that 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.
16. CONVERT :-
Converts FAT volumes to NTFS.CONVERT volume /FS:NTFS [/V]
volume Specifies the drive letter (followed by a colon), mount point, or volume name.
/FS:NTFS Specifies that the volume to be converted to NTFS.
/V Specifies that Convert should be run in verbose mode.
CONVERT C:/FS:NTFS
17. COPY :-
Copies one or more files to another location.COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination] [/A | /B]] [/V] [/Y | /-Y]
source Specifies the file or files to be copied.
/A Indicates an ASCII text file.
/B Indicates a binary file.
destination Specifies the directory or filename for the new file(s).
/V Verifies that new files are written correctly.
/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 preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line.
To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format).
Examples
copy *.* a:
Copy all files in the current directory to the floppy disk drive.
Note: If there are hidden files they will not be copied. To copy all files including hidden files use the xcopy command.
copy autoexec.bat c:\windows
18. Cprofile :-
Cleans specified profiles of wasted space and, if user-specific file associations are disabled, removes these associations from the registry. Profiles that are currently in use are not modified.
Syntax
cprofile [/l] [/i] [/v] [FileList]cprofile [/i] [/v] FileList
Parameters
/l : Cleans all local profiles. You can also specify a list of additional profiles in the FileList parameter. /i : Interactively prompts the user with each profile.
/v : Displays information about the actions being performed.
FileList : A list of files from which you want to remove user-specific file associations. Separate each file in the list with a space. File names can contain wildcard characters.
/? : Displays help at the command prompt.
19. Date :-
Displays the current system date setting. Used without parameters, date displays the current system date setting and prompts you to type a new date.
Syntax
date [mm-dd-yy] [/t]
Parameters
mm-dd-yy : Sets the date specified where mm is month, dd is day, and yy is year. /t : Displays the current date without prompting you for a new date.
/? : Displays help at the command prompt.
No comments:
Post a Comment