Command Prompt

The Windows command-line tool is a throwback to a simpler age of computing, before the luxury of mouse pointers and application windows. Now with a graphical interface as attractive as Windows 10’s, it is easy to forget that the OS comes even comes with a command-line interface as well. Most tasks have been replaced by some sort of user interface but there will be some tasks that you can still only do from the command prompt so it is a tool still worth using.

As an experienced user, you will always know the power of the Windows command prompt and the use of all of the cool tricks you can perform to help you gather more information about computers and create batch files to run automatic tasks on multiple computers at once to complete tasks remotely.  Whether you want complete information about connected networks, fix file errors, get info about hardware components, or manage volume drives, you can do it all via command prompt.

In this article, we will comer some of the cool commands that I still use frequently and some that you should know and could really help you out.

Manage Your IP Address

One of the number one tasks I will use the command prompt for as a network admin is managing the IP address. Changing your IP address can come in handy for various reasons. If you need to change yours, type

ipconfig /release
ipconfig /renew

The first command will release your current IP address while the second command will get a new IP address for your machine.

Flushing your computer’s DNS can be used when a site changes its IP address so you’re not taken in the wrong direction. Type

ipconfig /flushdns

and enjoy that clean start.

Show active network connections

Netstat is another handy command and can be a powerful network troubleshooting command that shows both incoming and outgoing connections to your PC along with the protocol type. Not only that, but you can also use netstat command to do a bunch of other things using parameters. You can see the routing table, the number of bytes and packets sent/received, process ID (PID), program name that established the connection, and many more.

Get motherboard information

If you bought a pre-built PC, the motherboard keeping everything together inside may be a bit of a mystery. But if you want to update the BIOS, replace the motherboard, or even just out its name, then you can do so through the command prompt. Just enter the following:

wmic baseboard get product,version,serialnumber,product

This should bring up all the main info about your motherboard.

Copy CMD output to clipboard

If you want to share information displayed in your command prompt with other people, it can be a bit unwieldy trying to take a screenshot or highlight everything it says. Instead, you can copy the output of your command to the Windows clipboard with the following command:

| clip

So if you want to copy all your ipconfig info to the clipboard, the whole command would be ipconfig | clip.

You can then paste the information into a word processor, an email, an online forum – wherever you like!

Stop any command mid-operation

Since you might be testing some commands… pressing Ctrl + C will cancel a command that you’ve already entered and allow you to begin typing another one, while typing cls will clear the current window of any commands that you’ve entered.

See If packets are making it to a specific device

With the ping command you can find out if packets are being delivered to a device. Just type

ping URL

or

ping IP ADDRESS

(Replace the URL and IP ADDRESS in the command) and packets will be sent. If you get them back, you will know everything is working just fine. If not, there is obviously something getting in the way.

Recover Windows 10 product key

recover Windows product key using CMD is very simple. All you need to do is fire up a Command Prompt window with the administrator rights. To do this, search for cmd in the Windows search bar and right-click to choose the elevated permissions option.

Now, type the following command in Command Prompt and hit Enter:

wmic path softwarelicensingservice get OA3xOriginalProductKey

Get info on what a command means

This is a useful command if you’re just getting to know the command prompt. Type

COMMAND/?

Replace “COMMAND” with the exact command you want to learn more information about. For example, to find out what the command ipconfig does, enter

ipconfig/?

The command prompt will show you the command and what it does.

Execute one command right after the other

If there are various commands you need to enter, this tip can save you some time. Just type && between the commands and sit back and relax.

Create custom recovery images

Recimg is a cmd command which is used to create custom recovery images. Whenever you install a new Window then you can use this command to create your own recovery images. It will remove all the manufacturer-installed bloatware and add your own desktop programs to your recovery image. So, just type recimg/ createimage image path, for instance : – recimg/createimage c:\images\image1

Scan and repair files

To scan and repair files on your computer, type

sfc /scannow

nd hit Enter. The time this task will take will depend on how fast your computer is. This could easily take up to an hour or so.

SFC scannow

Repairs issues with the running operating system

“DISM.exe /Online /Cleanup-Image /Restorehealth” is a DISM command that repairs issues with the running Operating system you are logged into.

DISM

Manage your computer’s energy

There are various things you can see on your computer with the powercfg command. For example, by using the command

powercfg /a

you can view your computer’s sleep states.

Powercfg can also let you do things such as:

  • powercfg /list – Shows you all the power schemes in the current user’s environment
  • powercfg /energy – After observing your computer for 60 seconds it will create an HTML report with data on how power efficient your computer is.
  • powercfg /sleepstudy – If your device supports InstantGo devices and applications, you can learn which ones are waking up your computer by using this command.
  • powercfg /query – Returns a power setting subgroup GUID.

List of file associations

Files are affiliated with a certain program in Windows. When you open a program, certain files are opened automatically. If you wish to associate these files with a program, you can use the assoc command.

By typing assoc into the command prompt, you can see a list of program associations and file name extensions. Let’s say that you want the text files to be associated with something else, type:

assoc.txt= "APPLICATION NAME"

(Replace “APPLICATION NAME” with the exact application name.)

Get a list of your computer’s drivers

Find out if you ever installed that driver by using the driverquery command. Hit Enter once you’ve typed it and you’ll see a list of every driver on your computer. You’ll see info such as Link date, Name, and Type.

Find shared folders

To see what folders you’ve shared, just type the command

net share

and press Enter. The command will also show you their shared names.

Run commands as an Administrator

With this command you can run any command as an administrator even if the person using the computer doesn’t have that privilege. Type

runas /user:yourdomainadministrator cmd

and after make some changes.

Add your real domain name and substitute administrator with the actual user name of a Domain Administrator. Change cmd with the command you want to try, and you can run as an administrator regardless of who’s logged in.

Make your Command Prompt colorful

You can change the color of the Windows Command Prompt to make it look visually appealing. To do so, right-click in the top corners of the Command Prompt window and select Properties. There, find the Colors tab and look for the options to change the background and text color.

Leave a Reply

Your email address will not be published.