Home » Questions » Computers [ Ask a new question ]

Take a screen shot from command line in Windows

Take a screen shot from command line in Windows

I am looking for a way to take a screenshot of the entire screen from the command line. Operating system is Windows. Something like this:

Asked by: Guest | Views: 98
Total answers/comments: 5
Guest [Entry]

"Download imagemagick. Many command line image manipulation tools are included. import allows you to capture some or all of a screen and save the image to a file. For example, to save the entire screen as a jpeg:

import -window root screen.jpeg

If you want to use the mouse to click inside a window or select a screen region & save a a png, just use:

import box.png"
Guest [Entry]

"it can be done without external tools (you just need installed .net framework ,which is installed by default on everything from vista and above) - screenCapture.bat. It is a selfcompiled C# program and you can save the output in few formats and capture only the active window or the whole screen:

screenCapture- captures the screen or the active window and saves it to a file
screenCapture filename.format [WindowTitle]

filename - the file where the screen capture will be saved
format - Bmp,Emf,Exif,Gif,Icon,Jpeg,Png,Tiff and are supported - default is bmp
WindowTitle - instead of capturing the whole screen will capture the only a window with the given title if there's such


call screenCapture notepad.jpg ""Notepad""
call screenCapture screen.png"
Guest [Entry]

"You can try the boxcutter tool:

usage: boxcutter [OPTIONS] [OUTPUT_FILENAME]

Saves a bitmap screenshot to 'OUTPUT_FILENAME' if given. Otherwise,
screenshot is stored on clipboard by default.

-c, --coords X1,Y1,X2,Y2 capture the rectange (X1,Y1)-(X2,Y2)
-f, --fullscreen fullscreen screenshot
-v, --version display version information
-h, --help display help message"
Guest [Entry]

"Screenshot-cmd takes a screenshot of a desktop or any window selected by window title. It is also possible to select rectangle to capture. The result is stored as a png file. (last update in 2011)

Select window with this title.
Title must not contain space ("" "").
Select window by it's handle
(representad as hex string - f.e. ""0012079E"")
Crop source. If no WINDOW_TITLE is provided
(0,0) is left top corner of desktop,
else if WINDOW_TITLE maches a desktop window
(0,0) is it's top left corner.
Output file name, if none, the image will be saved
as ""screenshot.png"" in the current working directory.
Shows this help info.

Inspired by: http://blog.mozilla.com/ted/2009/02/05/command-line-screenshot-tool-for-windows/"
Guest [Entry]

"You can use the Pillow python library to take screenshots of the primary monitor

Step1: install Pillow:

pip install -user pillow

Step2: Take screenshots with the following code:

from PIL import ImageGrab
img = ImageGrab.grab()