Windows 7 Forums


Reply
Thread Tools

Windows 7 CMD Help & Tips

 
 
Fire cat Fire cat is offline
Established Member
Join Date: Mar 2010
Posts: 1,157
Thanked: 166
 
      05-05-2010
Hey Guys!
Ok, so I noticed that it is very hard to find a proper list of all common windows 7 command line commands. So I decided to make a list myself. Also I added the use of some common commands and tips about the windows 7 command-line at the end of the post. Even though it might look scary at first for newbies, command-line can be very useful.
Also, a big thanks to Clifford, who made a free downloadable guide of the Commands Prompt.

Download the Command Prompt Book: Books.zip
Books.zip made by Clifford_Cooley


Windows 7 Command Line Common Commands:

ASSOC: Displays or modifies file extension associations.
ATTRIB: Displays or changes file attributes.
BREAK: Sets or clears extended CTRL+C checking.
BCDEDIT: Sets properties in boot database to control boot loading.
CACLS: Displays or modifies access control lists (ACLs) of files.
CALL: Calls one batch program from another.
CD: Displays the name of or changes the current directory.
CHCP: Displays or sets the active code page number.
CHDIR: Displays the name of or changes the current directory.
CHKDSK: Checks a disk and displays a status report.
CHKNTFS: Displays or modifies the checking of disk at boot time.
CLS: Clears the screen.
CMD: Starts a new instance of the Windows command interpreter.
COLOR: Sets the default console foreground and background colors.
COMP: Compares the contents of two files or sets of files.
COMPACT: Displays or alters the compression of files on NTFS partitions.
CONVERT: Converts FAT volumes to NTFS. You cannot convert the
current drive.
COPY: Copies one or more files to another location.
DATE: Displays or sets the date.
DEL: Deletes one or more files.
DIR: Displays a list of files and subdirectories in a directory.
DISKCOMP: Compares the contents of two floppy disks.
DISKCOPY: Copies the contents of one floppy disk to another.
DISKPART: Displays or configures Disk Partition properties.
DOSKEY: Edits command lines, recalls Windows commands, and
creates macros.
DRIVERQUERY: Displays current device driver status and properties.
ECHO: Displays messages, or turns command echoing on or off.
ENDLOCAL: Ends localization of environment changes in a batch file.
ERASE: Deletes one or more files.
EXIT: Quits the CMD.EXE program (command interpreter).
FC: Compares two files or sets of files, and displays the
differences between them.
FIND: Searches for a text string in a file or files.
FINDSTR: Searches for strings in files.
FOR: Runs a specified command for each file in a set of files.
FORMAT: Formats a disk for use with Windows.
FSUTIL: Displays or configures the file system properties.
FTYPE: Displays or modifies file types used in file extension
associations.
GOTO: Directs the Windows command interpreter to a labeled line in
a batch program.
GPRESULT: Displays Group Policy information for machine or user.
GRAFTABL: Enables Windows to display an extended character set in
graphics mode.
HELP: Provides Help information for Windows commands.
ICACLS: Display, modify, backup, or restore ACLs for files and
directories.
IF: Performs conditional processing in batch programs.
LABEL: Creates, changes, or deletes the volume label of a disk.
MD: Creates a directory.
MKDIR: Creates a directory.
MKLINK: Creates Symbolic Links and Hard Links
MODE: Configures a system device.
MORE: Displays output one screen at a time.
MOVE: Moves one or more files from one directory to another
directory.
OPENFILES: Displays files opened by remote users for a file share.
PATH: Displays or sets a search path for executable files.
PAUSE: Suspends processing of a batch file and displays a message.
POPD: Restores the previous value of the current directory saved by
PUSHD.
PRINT: Prints a text file.
PROMPT: Changes the Windows command prompt.
PUSHD: Saves the current directory then changes it.
RD: Removes a directory.
RECOVER: Recovers readable information from a bad or defective disk.
REM: Records comments (remarks) in batch files or CONFIG.SYS.
REN: Renames a file or files.
RENAME: Renames a file or files.
REPLACE: Replaces files.
RMDIR: Removes a directory.
ROBOCOPY: Advanced utility to copy files and directory trees
SET: Displays, sets, or removes Windows environment variables.
SETLOCAL: Begins localization of environment changes in a batch file.
SC: Displays or configures services (background processes).
SCHTASKS: Schedules commands and programs to run on a computer.
SHIFT: Shifts the position of replaceable parameters in batch files.
SHUTDOWN: Allows proper local or remote shutdown of machine.
SORT: Sorts input.
START: Starts a separate window to run a specified program or command.
SUBST: Associates a path with a drive letter.
SYSTEMINFO: Displays machine specific properties and configuration.
TASKLIST: Displays all currently running tasks including services.
TASKKILL: Kill or stop a running process or application.
TIME: Displays or sets the system time.
TITLE: Sets the window title for a CMD.EXE session.
TREE: Graphically displays the directory structure of a drive or
path.
TYPE: Displays the contents of a text file.
VER: Displays the Windows version.
VERIFY: Tells Windows whether to verify that your files are written
correctly to a disk.
VOL: Displays a disk volume label and serial number.
XCOPY: Copies files and directory trees.
WMIC: Displays WMI information inside interactive command shell.

Windows 7 Command-Line Tips and Tricks

Open CMD anywhere:
Go to the place in question in Windows Explorer, then press Shift + Right-Click. You will now notice that in the list of options, there will appear "Open command Windows here."

Open an Elevated Command Prompt:
Click on Start and in the search bar, type "cmd". Press on Ctrl + Shift + Enter. Click on "Yes" when User Account Control pops up. You will now notice that you are in C:\WINDOWS\system32.

Drag and Drop to Command Prompt:
From Windows Explorer, you can drag and drop files into an open Command Prompt. That will display the full pathname to the file in question. Plus, if you Enter, you can execute the file.

Copy and paste from the command line:
Right-Click and select Mark. Now, drag over the area you want to copy, hit Enter and the text is copied to the clipboard. Similarly, you can click on the icon in the title bar and choose Paste to paste the text you already have on the clipboard.

Hit F7 for command line history:
Hit F7 and you will get a complete list of commands that you executed. Use the arrow keys to highlight the command you want to run again or just hit the number key corresponding to the command that you want to execute.

Run multiple commands:
You can run multiple command by separating them with &&. Note that this doesn’t run the commands simultaneously. Instead, the command towards the left is run first and if it completes successfully then the second command will run. If the first command fails, then the second command will not run.

Ex: MKDIR C:\FOLDER && RD C:\FOLDER

Go fullscreen:
Hit Alt+Enter and now you have the entire screen to enter your commands and view the output. Sadly. this doesn’t always work.

Navigate the HDD:
To go somewhere on the HDD, type CD C:\%Where you want to go%. You can also type
CD %where you want to go INSIDE the dir%.

Will be adding new tips and tricks soon…

So that's it! Please comment and tell me if you would like to add a new tip. Also please tell me which commands you would like to see highlighted!

Cheers,
Fire Cat

Last edited by Fire cat; 05-06-2010 at 07:18 PM.. Reason: Added Clifford's Books download link!
 
Reply With Quote
 
 
 
 
davehc davehc is offline
Established Member
davehc's Avatar
Join Date: Jul 2009
Location: Denmark
Posts: 1,937
Thanked: 413
 
      05-06-2010
They are all actually in Windows Help and support.- Just type Command.com in the Help and support search panel.
 
Reply With Quote
 
 
 
 
Fire cat Fire cat is offline
Established Member
Join Date: Mar 2010
Posts: 1,157
Thanked: 166
 
      05-06-2010
Quote:
Originally Posted by davehc View Post
They are all actually in Windows Help and support.- Just type Command.com in the Help and support search panel.
They are? All I find in Help and Support and on the Microsoft Website is "Command-line reference for IT Pros", and that doesn't give a list, all that does is tell you how to do common tasks... Ah well... If the list isn't usefull to anybody, then I hope the tricks are...

Cheers,
Fire Cat
 
Reply With Quote
 
davehc davehc is offline
Established Member
davehc's Avatar
Join Date: Jul 2009
Location: Denmark
Posts: 1,937
Thanked: 413
 
      05-06-2010
Ok. Does for me. But, not forgetting, you can type "Help at the command prompt and get the lot.

Last edited by davehc; 05-06-2010 at 01:53 PM..
 
Reply With Quote
 
Digerati Digerati is offline
Post Quinquagenarian
Digerati's Avatar
Join Date: Apr 2010
Location: Nebraska, USA
Posts: 1,039
Thanked: 217
 
      05-06-2010
Nice list there, but yeah, Google is your friend and finding a complete list is not hard. About.com has an extensive list. And simply typing help at the command prompt reveals most too.

Of course, most folks today have little, if any, reason to use command prompt commands. But those of us who have been around awhile still like to step out of the GUI every once in a while.
 
Reply With Quote
 
Nibiru2012 Nibiru2012 is offline
Quick Scotty, beam me up!
Nibiru2012's Avatar
Join Date: Oct 2009
Location: Planet X
Posts: 4,956
Thanked: 1102
 
      05-06-2010
A very useful thread to say the least!

Thanks to all for the OP and helpful suggestions!
 
Reply With Quote
 
Veedaz Veedaz is offline
~
Veedaz's Avatar
Join Date: Sep 2009
Location: England
Posts: 1,988
Thanked: 332
 
      05-06-2010
Good stuff fire cat, Ive just printed it
 
Reply With Quote
 
Fire cat Fire cat is offline
Established Member
Join Date: Mar 2010
Posts: 1,157
Thanked: 166
 
      05-06-2010
Quote:
Originally Posted by Digerati View Post
Nice list there, but yeah, Google is your friend and finding a complete list is not hard. About.com has an extensive list. And simply typing help at the command prompt reveals most too.
Yes... Though, that was the only real list of commands for Windows 7 I found as well. All the others I found were for XP... Also, I don't know about you, but I still prefer having all the commands with there meanings on one page, instead of 10.

Quote:
Originally Posted by Digerati View Post
Of course, most folks today have little, if any, reason to use command prompt commands. But those of us who have been around awhile still like to step out of the GUI every once in a while.
Yep, I agree, though even though it might not seem very usefull for most people, because you can use Windows explorer for most of the "DIR, MKDIR, RD..." commands, It is still usefull to get information from the computer: eg: SYSTEMINFO, and to do tasks that can't be done otherwise

Also, don't forget that all these commands can be used in a batch (.bat) or cmd (.cmd) files!

Cheers,
Fire Cat
 
Reply With Quote
 
davehc davehc is offline
Established Member
davehc's Avatar
Join Date: Jul 2009
Location: Denmark
Posts: 1,937
Thanked: 413
 
      05-06-2010
One of the improvements(?? Some may not think so) in Vista, and subsequently 7, was that many of the old Dos commands can now be used via the GUI. Windows 7 introduced the Power shell also, which had a few more for the enthusiasts!
Look at this list. It is interesting to note that only those with an asterisk need to be run specifically from the Command prompt. The others are all available through software. (Note at the end of the first list.)
The second half is the power shell. You can have a lot of fun (and disasters) trying some of them.
http://www.kapcom.com.au/Windows-CMD...-Commands.html
 
Reply With Quote
 
linuxdudex12 linuxdudex12 is offline
Established Member
linuxdudex12's Avatar
Join Date: Feb 2010
Location: /dev/null
Posts: 158
Thanked: 19
 
      05-06-2010
This is one of the best list and explaination of the commands I have seen... GOOD WORK!!!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced tips for searching in Windows 7 Yousuf Khan alt.windows7.general 10 08-20-2011 10:27 PM
77 Windows 7 Tips Ian News 11 06-29-2011 05:20 PM
move from cmd.exe 32 bit to cmd.exe 64 bit teg1545 Windows 7 Support 2 10-12-2010 11:54 AM
Cmd.exe / .bat help nev3r General Discussion 1 10-10-2010 12:00 PM
Tips- Using Grub4Dos install Windows 7 from USB Storage mjb Installation, Setup and Updates 0 06-24-2010 04:48 PM


All times are GMT +1. The time now is 04:00 AM.
W7Forums is an independent website and is not affiliated with Microsoft Corporation.