Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am looking for a open source of free tool that I could execute from the command line. It should take a screen shot of the screen and save it to a file. Operating system is Windows. Something like this:

C:\>screenshot.exe screen1.png
share|improve this question
1  
Why would you want to do something like that ? Apart from the obvious deficiency (it being able to take screenshots only of the command line you're currently working on), what's wrong with the "regular" solutions for such purpose ? –  ldigas Nov 26 '09 at 15:53
4  
Why would it be restricted to take a picture of the cmd line only? I think the question goes more along the lines of automation. –  Gerd Klima Nov 26 '09 at 15:57
    
Well, in the moment he wants to take a screenshot, he has to press enter to give the command, doesn't he ? He could of course use a script to time-activate it, but then he's really reinventing hot water. –  ldigas Nov 26 '09 at 16:00
    
I would like to write a script that opens eml file in Thunderbird, takes a screen shot, opens another file, takes another screen shoot... For all files in a folder. I want to execute screen shot tool from the command line, so it could be automated. Just to be clear, I do not want to take a screen shot of command line, but of the entire screen. In fact, I have already written the script, I am just looking for more options to take the screen shot. –  Željko Filipin Nov 27 '09 at 11:10
add comment

7 Answers 7

up vote 19 down vote accepted

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
share|improve this answer
9  
This doesn't seem to work on Windows. I get an X server error about file not found. –  Binary Phile Apr 5 '11 at 18:14
    
@BinaryPhile Yea I think this would only work with an X server running on Cygwin. –  CMCDragonkai May 12 at 8:42
add comment

This question's already been answered, but I thought I'd throw this in as well. NirCmd (freeware, sadly, not open source) can take screenshots from the command line, in conjunction with the numerous other functions it can do.

Running this from the command line either in nircmd.exe's directory or if you copied it to your system32 folder:

nircmd.exe savescreenshot screen1.png

does what you want. You can also delay it like this:

nircmd.exe cmdwait 2000 savescreenshot screen1.png

That will wait 2000 milliseconds (2 seconds), and then capture and save the screenshot.

share|improve this answer
3  
+1 for this great utility, 36.8 Kb of pure goodness –  Krazy_Kaos Nov 11 '11 at 17:00
    
+10 this utility is awesome! –  jon3laze Aug 24 '12 at 20:23
add comment

Other suggestions are fine -- you could also try MiniCap, which is free and has some other features like flexible file naming and some different capture modes: http://www.donationcoder.com/Software/Mouser/MiniCap/index.html

(disclaimer: I'm the author of MiniCap).

share|improve this answer
    
Then you must also be the author of Screenshot Captor. I found it a better solution for my needs. Thank you! –  jon3laze Aug 24 '12 at 20:50
add comment

Screenshot-cmd


OPTIONS:
    -wt WINDOW_TITLE
            Select window with this title.
            Title must not contain space (" ").
    -wh WINDOW_HANDLE
            Select window by it's handle
            (representad as hex string - f.e. "0012079E") 
    -rc LEFT TOP RIGHT BOTTOM
            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.
    -o FILENAME
            Output file name, if none, the image will be saved
            as "screenshot.png" in the current working directory.
    -h
            Shows this help info.

share|improve this answer
add comment

Try IrfanView.

You can run it via command-line. You can specify which window to capture – such as whole window or just the current/active window – and you can also do some basic editing such as sharpening, cropping or resizing the images.

Here are the command line options.

share|improve this answer
add comment

You can use snapit to take awesome screenshots from the command line.

share|improve this answer
    
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. –  Diogo Aug 9 '12 at 20:11
add comment

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.

OPTIONS
  -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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.