How to Automatically Take a Screenshot and Open it in a Editor?

Looking for a way to automatically take a screenshot and open it in an image editor like Paint in Windows10? If yes, is the answer, then I recommend you must not miss checking this article.

how to automatically take screenshot and open it in image editor
Image: windowscentral.com

One of the quickest ways to take a screenshot of full screen in Windows 10 is by using WinKey and Prnt Scrn key and automatically save the screenshot in .png file.

When you take a screenshot using above method, the screenshot includes your complete screen containing the Taskbar and everything. In most of the cases, you may want to crop the screenshot before sharing it on your site or with someone so that the relevant part is visible to the receiver. Right? No problem, we have a solution for this problem.

You can use Alt + PrintScreen keys, as it will take the screenshot of the active windows excluding the taskbar and everything, but it does not save to a file automatically. Also, it fails to capture context menus.

How to Automatically Take a Screenshot and Open it in an Editor

In today’s tutorial, I will share with you an amazing workaround or method which is shared by Winhelponline. I personally like it and found it much better in comparison of Sniping tool and Alt + PrintScreen method.

Here is the script that automates the process of capturing a full screenshot using NirCmd and opening the saved .png file in an image editor. So that you can crop the screenshot and save the file before sharing it with someone.

'Viney Dhiman, Winranx.com
Set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")

'Sleep for 2 seconds until the user sets the active Window or menu
WScript.Sleep 2000

'Take full screenshot
WshShell.Run "nircmd.exe " & "sendkeypress rwin+printscreen"

'Sleep again for half a second - wait until the PNG file is written
WScript.Sleep 500

Dim fNewest

'Find the latest PNG file in Screenshots folder and Open it in editor.
SShots = WshShell.ExpandEnvironmentStrings("%userprofile%")
SShots = SShots & "\Pictures\Screenshots"
If fso.FolderExists(SShots) then
	For Each f In fso.GetFolder(SShots).Files
		If UCase(fso.GetExtensionName(f)) = "PNG" Then  
   			If fNewest = "" Then
   				set fNewest = f
   			ElseIf fNewest.DateLastModified < f.DateLastModified Then
   	  			set fNewest = f
   	  		End If
   		End If
	Next
If fNewest <> "" Then WshShell.Run "mspaint.exe " & Chr(34) & fNewest & Chr(34)
End If

Here is how to use this script to take a screenshot and automatically open it in an MS Paint

1. Download the NirCmd utility from NirSoft and move the executable file into your Windows folder.

2. Open the Notepad file and paste the above line of code or script into it and save it with a .vbs extension.

Automatically Take a Screenshot and Open it in an Editor using .VBS Script

For example, takescreenshot.vbs or winranx.vbs

Automatically Take a Screenshot and Open it in an Editor using .VBS Script

3. Simply create the desktop shortcut of the .vbs script file. For that, right-click on the file and from the options click on “Create Shortcut“.

Automatically Take a Screenshot and Open it in an Editor using .VBS Script

4. Change the shortcut icon. For that, right-click on the desktop shortcut and from the options click on Properties.

Automatically Take a Screenshot and Open it in an Editor using .VBS Script

Here click on “Change icon” button. Select the icon of your choice. Click on “Apply” button to confirm the changes.

Automatically Take a Screenshot and Open it in an Editor using .VBS Script

5. Pin it to Windows 10 Taskbar. For that, drag the desktop shortcut and drop it on the taskbar.

That’s it

Now whenever you want to take the screenshot, you need to click on the .vbs (script file) shortcut. This will execute the script, take a screenshot and open the image in MS Paint. Simply edit the image and save it wherever you want.

Tip: When you click to run the script, it will take two seconds to capture the screen. I guess it is sufficient time to prepare your screen for a screenshot. This time out is very useful if you want to take a screenshot of the context menu.

Automatically Take a Screenshot and Open it in an Editor using ShareX

Alternatively, you can also use a third party tool named as ShareX that comes with some additional features like uploading the screenshot to cloud storage account or sharing the screenshot link in social networking sites. Under settings of this tool, you can also configure what to do after taking a screenshot and create an action which automates the procedure.

Here is how to configure it:

1. Download ShareX. Install it on your computer and then launch it.

2. Click on “After capture task“. Scroll down to “Perform Actions“. Click to set it.

Automatically Take a Screenshot and Open it in an Editor using ShareX

3. After that, click on the “Task Settings” tab -> Actions, here you will get the list of all the image editor. Simply enable the check box for the image editor which you want to use.

Automatically Take a Screenshot and Open it in an Editor using ShareX

If your image editor is listed here, click on the “Add” button to add it manually.

That’s it!

I hope you will find these both methods useful. Let us know what you think about these methods in the comments.

Leave a Reply

Your email address will not be published. Required fields are marked *