Language: EN


How to take a ScreenShot from the command prompt in Windows

Let’s go with a little tip, how to take a ScreenShot from the command prompt in Windows

Just like the other day we saw how to capture an image from a Webcam from the command prompt, sometimes it can be useful to take a ScreenShot from a terminal.

It’s not something you’re going to do every day. But sometimes, in management and administration of equipment, or task automation, or integrations between programs, you might need it. Well, you’ve come to the right place.

There are many ways to take a screenshot from the console, but one of the simplest is with the NirCmd tool, a free portable application from NirSoft.

NirCmd includes many interesting features that we can launch from a command prompt. Among them is the ability to take a screenshot.

I recommend looking at the rest of NirCmd’s features, because some of them might save your day.

To do this, we just have to download the application from the project’s website, where the documentation is also included.

Now we just have to launch the command with the savescreenshot parameter, followed by the output file name.

nircmd.exe savescreenshot "c:\temp\file_name.png"

We can choose to capture only a region of the desktop, indicating the X, Y coordinates, and the width and height. Like this

nircmd.exe savescreenshot savescreenshot "c:\temp\file_name.png" 50 50 300 200 

We can also copy the image to the clipboard, instead of to a file, like this

nircmd.exe savescreenshot *clipboard* 

In addition, we can specify the width and height of the capture and the destination, either the clipboard or a file on disk.

If we have multiple monitors connected, we can use the savescreenshotfull command followed by the output file name.

nircmd.exe savescreenshotfull "c:\temp\file_name.png"

And if we want to capture only the active window we can use savescreenshotwin

nircmd.exe savescreenshotwin "c:\temp\file_name.png"

As we can see, it is very easy to take a ScreenShot from the command prompt in Windows with the NirCmd tool.

As I said, this tool also offers many more features that may be interesting. Take a look at the rest of the available options!