Let’s go with a quick tip: how to take a Screenshot from the command line in Windows.
Just like the other day we saw how to capture an image from a Webcam via the command line, sometimes it can be useful to take a Screenshot from a terminal.
It’s not something you’ll likely do every day. But sometimes, in equipment management and administration, or task automation, or program integrations, you might need it. Well, you’ve come to the right place.
There are many ways to take a screenshot from the command line, but one of the simplest is with the NirCmd tool, a free portable application from NirSoft.
NirCmd includes many interesting functionalities that we can launch from a command line. Among them is the ability to take a screenshot.
I recommend you check out the rest of NirCmd’s functionalities, because one of them might just save your day.
To do it, we simply have to download the application from the project’s website https://www.nirsoft.net/utils/nircmd.html, where the documentation is also included.
Now we just have to run the command with the savescreenshot parameter, followed by the output filename.
nircmd.exe savescreenshot “c:\temp\nombre_fichero.png”
We can choose to capture only a region of the desktop, by specifying the X, Y coordinates, and the width and height. Like this:
nircmd.exe savescreenshot savescreenshot “c:\temp\nombre_fichero.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
Furthermore, we can specify the width and height of the capture and the destination, whether it’s the clipboard or a file on disk.
If we have multiple monitors connected, we can use the savescreenshotfull command followed by the output filename.
nircmd.exe savescreenshotfull “c:\temp\nombre_fichero.png”
And if we want to capture only the active window we can use savescreenshotwin
nircmd.exe savescreenshotwin “c:\temp\nombre_fichero.png”
As we can see, it’s very easy to take a Screenshot from the command line in Windows with the NirCmd tool.
As I said, this tool also offers many more functionalities that can be interesting. Take a look at the rest of the available options!

