Windows 7 CMD Help & Tips

Fire cat

Established Member
Joined
Mar 7, 2010
Messages
1,157
Reaction score
191
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:

davehc

Microsoft MVP
Joined
Jul 20, 2009
Messages
1,958
Reaction score
502
They are all actually in Windows Help and support.- Just type Command.com in the Help and support search panel.
 

Fire cat

Established Member
Joined
Mar 7, 2010
Messages
1,157
Reaction score
191
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
 

davehc

Microsoft MVP
Joined
Jul 20, 2009
Messages
1,958
Reaction score
502
Ok. Does for me. But, not forgetting, you can type "Help at the command prompt and get the lot.;)
 
Last edited:

Digerati

Post Quinquagenarian
Microsoft MVP
Joined
Apr 7, 2010
Messages
1,094
Reaction score
277
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.
 

Nibiru2012

Quick Scotty, beam me up!
Joined
Oct 27, 2009
Messages
4,955
Reaction score
1,302
A very useful thread to say the least!

Thanks to all for the OP and helpful suggestions!
 

Veedaz

~
Joined
Sep 1, 2009
Messages
1,988
Reaction score
374
Good stuff fire cat, Ive just printed it :top:
 

Fire cat

Established Member
Joined
Mar 7, 2010
Messages
1,157
Reaction score
191
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.

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
 

davehc

Microsoft MVP
Joined
Jul 20, 2009
Messages
1,958
Reaction score
502
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-CMD-Network-Commands.html
 
Joined
Feb 17, 2010
Messages
158
Reaction score
25
This is one of the best list and explaination of the commands I have seen... GOOD WORK!!!
 
Joined
Mar 8, 2009
Messages
5,063
Reaction score
1,185
Here is a little something that I have put together over the years while writing scripts for Command-Line and Java-Script.
HTML_CommandLine.jpg
 

Attachments

Fire cat

Established Member
Joined
Mar 7, 2010
Messages
1,157
Reaction score
191
Here is a little something that I have put together over the years while writing scripts for Command-Line and Java-Script.
View attachment 985
Good one Clifford! Thanks a lot.
In was wondering, would you mind if I posted this link on the main post, so that everybody can have access to it easily?
Thanks,
Fire Cat
 

Fire cat

Established Member
Joined
Mar 7, 2010
Messages
1,157
Reaction score
191
Ok, so I added the link!
Hey, don't forget to post any tip or any command-line related information that you would like to share!

Thanks,
Fire cat
 
Last edited:
Joined
Nov 6, 2010
Messages
241
Reaction score
33
Command Prompt Tips

Command Prompt - Advanced Commands for System Information & Managing Active Tasks For Windows 7

Here are just a few easy commands to remember

How to View Your System Information;

Command Prompt allows you to view system information by using a simple command called systeminfo. Type it and see what happens. a complete list of information about your operating system and computer components will be displayed. There are details like the version of the operating system, status of your memory or processor type, and some network information is available like IP or MAC addresses.

Display the List of Currently Running Processes;

To view the list of currently running processes, you have to use the tasklist command. Type tasklist and press Enter.

Stop a Process Using Taskkill;

To kill or stop a running process, you need to use the taskkill command. Let's assume that you want to stop the application SnspShot that is running on your computer, Its process is called Snapshot.exe. type the command taskkill /im snapshot.exe. The /im parameter is used to stop a process by typing process name.

To kill any running process, you need to have administrative permissions and run the Command Prompt as administrator.

How to Use Help in Command Prompt;

In Command Prompt you just have to type the help command and then press Enter. A list of all available commands will be displayed.

If a certain command interests you type help followed by the name of the command. Another way to do the same thing is to type command_name followed by the /? parameter.

Testing the Connection to a Website or Network/Internet Location;

To test your connection to a certain website or another network or Internet location, you can use the ping network command followed by a web-address or IP address. For example, if you want to check the connectivity to our website, without opening a web browser, type ping www.w7forums.com and then press Enter.

Check Network Connections and Display Port Information;

With the netstat command you will be able to see active network connections between your system and any other systems on your network or the Internet.

The /a parameter shows all connections and listening ports.

For many more commands visit Here


Hope you found this useful
 

Attachments

davehc

Microsoft MVP
Joined
Jul 20, 2009
Messages
1,958
Reaction score
502
Hi Bugsy. This was covered earlier, but it is always worthwhile ressurecting!
I have merged it therefore with the earlier thread.
 
Joined
Apr 18, 2012
Messages
1
Reaction score
0
I've also found Houstname to be helpful displays the computer name but isn't listed in the "help" list
 

davehc

Microsoft MVP
Joined
Jul 20, 2009
Messages
1,958
Reaction score
502
As you say, not yet included in the thread. Thank you for the contribution. It might also resurrect the thread for those interested. (Its nearly a year old!) When helping, good idea to check your typing, particularly on a key word, it should be hostname.
 

Digerati

Post Quinquagenarian
Microsoft MVP
Joined
Apr 7, 2010
Messages
1,094
Reaction score
277
(Its nearly a year old!)Pushing 2 years - 18 months anyway.
 

TrainableMan

^ The World's First ^
Moderator
Joined
May 10, 2010
Messages
9,353
Reaction score
1,587
There was a post which woke up this thread last night and triggered your emails but I had moved it to its' own thread (see HERE) because it was really a new question. In fact it was moved before you reported the thread and before Dave's last post above. Hopefully that answers any questions/concerns as to what happened.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top