Take-Screenshot

This script has a function that allows you to take a screenshot of the entire desktop or of an active window. Also includes option to save the screenshot to a file.

 
 
 
 
 
4.6 Star
(18)
17,557 times
Add to favorites
Multimedia
2/25/2012
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Remote Screenshot
    1 Posts | Last post August 17, 2017
    • Anyway to use this to get a remote screenshot? No matter if you copy the script and get the logged in session and capture or some other means?
  • Screenshot is Blacked out
    2 Posts | Last post August 07, 2017
    • I'm trying to use this script to take screenshots on test stations where there is no monitor connected or active RDP running. Only sometimes I get the full screen most of the times blacked out. It works perfectly when desktop is viewed using RDP or via vga connected monitor. 
      
      Has anyone come across this issue before?
      
      Any help is much appreciated.
      
      Thanks
    • Solution for this problem can be found here:
      http://blogs.microsoft.co.il/arnona/2016/01/03/keeping-an-active-desktop-session/
  • It isn't working
    3 Posts | Last post July 27, 2017
    • C:\Users\xyz\Downloads>Take-ScreenShot -screen -file "C:\image.png" -imagetyp
      e png
      'Take-ScreenShot' is not recognized as an internal or external command,
      operable program or batch file.
      
      C:\Users\xyz\Downloads>powershell
      Windows PowerShell
      Copyright (C) 2009 Microsoft Corporation. All rights reserved.
      
      PS C:\Users\xyz\Downloads> Take-ScreenShot -screen -file "C:\image.png" -imag
      etype png
      The term 'Take-ScreenShot' is not recognized as the name of a cmdlet, function,
       script file, or operable program. Check the spelling of the name, or if a path
       was included, verify that the path is correct and try again.
      At line:1 char:16
      + Take-ScreenShot <<<<  -screen -file "C:\image.png" -imagetype png
          + CategoryInfo          : ObjectNotFound: (Take-ScreenShot:String) [], Com
         mandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException
      
      Am I missing anything here.
    • Sorry User error.It is working now.
      
      
    • same for me, thanks!
  • have an issue with screenshot in WPF app
    1 Posts | Last post July 27, 2017
    • I'm curious, if you are able to provide a solution of following issue?
      https://social.msdn.microsoft.com/Forums/en-Us/b5f182e1-ecba-45cc-b578-1264c0c23bc8/wpf-application-blocks-print-screen-button?forum=windowsgeneraldevelopmentissues
  • Problem when taking Screen shots in 4k
    1 Posts | Last post May 05, 2017
    • First of all thank you very much to Boe for this very good script.
      It works fine for me with resolutions up to Full HD (1920x1080).
      Meanwhile I wanted to have the need to take some very accurate shots of some windows.
      I picked up a 4k (3840 × 2160) monitor and repeated the process I used to do.
      The strange thing is that the images get cropped !
      When doing a screen shot of the active window the images only have 2400x1350 !!!
      I'm not a C# expert but I went through the C# code of "private Image CaptureWindow(IntPtr handle)" and could not see any kind of limit in the size of the capture image.
      Is there any other kind of limit I'm not seeing ?
      Can you help me on that ?
      
      Thank you very much.
      Kind regards,
      Paul
      
  • Strange Issue w/ This Script
    1 Posts | Last post March 07, 2017
    • Okay, so I have successfully managed to get the script to run as described here for the most part. I'm running it on a Windows 10 machine and it works flawlessly as long as the output is to a local file. No issues there. 
      
      The strange thing is when I attempt to save the output to a mapped drive or network share either by the share name or IP address, I get an error in Powershell. I'm not in that particular machine at the moment so I can't post it yet. I have the task setup to repeat every minute so that I am getting continuous updates of the active window. Here's the really weird part about it, I will get the error continuously until I manually open Task Scheduler, then the error goes away and the script works perfectly. I don't even have to open the task. I just open Task Scheduler. I can immediately close it and it will continue to work perfectly until the machine reboots. Out of frustration I even attempted to create a task in TS that automatically launches Task Scheduler before the Take-Screenshot script runs and it has no effect. I have to manually launch Task Scheduler and it works fine. Again, when I save it locally this problem doesn't exist. Only when saved to a network location. 
      
      Any ideas???
  • Take ScreenShot both monitors
    1 Posts | Last post February 14, 2017
    • How can I use this script to take snapshots of my both monitors?
      This command only take the primary monitor and I need both screens
      .\Take-ScreenShot -screen -file "D:\image.png" -imagetype png
      
      
      And I need to save all files with diferents names or date like
      image1.png
      image2.png
      image3.png
      
      or
      
      imageYYYYMMDDHHMM.png
      image201702141520.png
      image201702141521.png
      image201702141522.png
      
      
      Any of you could help me please?
      Regards
      Patricio
  • How to make this work?
    1 Posts | Last post October 29, 2016
    • I tried Andreas Kossatz's suggestion but it doesn't work. Well what I did from his suggestion is that I changed the script content the way he suggests and then I made a shortcut of the ps1 file and in the shortcut properties I went under Target and pit:
      
      Z:\Desktop\Take-ScreenShot.ps1 -file z:\desktop\balbla02.png -imagetype png -screen
      
      at least this is what I understood I should do according to his examples:
      .\Take-ScreenShot.ps1 -file C:\temp\balbla02.png -imagetype png -activewindow (works)
      .\Take-ScreenShot.ps1 -file C:\temp\balbla02.png -imagetype png -screen (works)
      .\Take-ScreenShot.ps1 -file C:\temp\balbla02.png -imagetype png (dont works)    
      .\Take-ScreenShot.ps1 -activewindow OR -screen ( only display some information)
      
      or did I misunderstand?
      
      Well, no matter what, as Boe mentioned, there MUST be a how-to article for us noobs,cos I like the idea of simply running this powershell script and generating a screenshot, because I don't want to use any 3rd party tools. I need this cos I have a small bt keyboard and I want to assign one key to take a screenshot. I cannot do it with the program called SharpKeys (though I love it) cos it does not allow the PrntScr key to be swapped. Ofc I managed to achieve what I want with some 3rd party tools but I wanna stay away from those and have sth as simple as a srcrip which executes and maybe doesn't even output a file directly, but instead simply puts the screenshot on my clipboard as the normal PrntScrn key would do. Any ideas?
  • HOW DOES THIS WORK
    2 Posts | Last post June 28, 2016
    • Was sent here to download but all I got was a notepad that opens with a load of fluff and bumpf. So what does this do and how does it work. Running 64 bit windows 10  and UK based and I do not understand technical terms
    • I thought that I had an article about this, but I guess not. I'm currently working to update this function and will have an article to accompany it sometime in the coming weeks. That link will be posted here when it goes live.
  • Need a little more functionality added to it
    1 Posts | Last post March 26, 2016
    • Hi Boe,
      
      I need something similar to this, where it will take a screenshot of an active window and open an new email with the screenshot pasted. Is it possible ?
1 - 10 of 13 Items