Windows 10 Make snipping tool capture after launching

Joined
Nov 17, 2009
Messages
36
Reaction score
2
I can create a batch file to launch snippingtool with the following code

Start "" "C:\windows\system32\SnippingTool.exe"

I would like to add to that a command line that selects 'NEW'
to make the tool snip ready.
I need help with that step.
 

muckshifter

I'm not weird, I'm a limited edition.
Moderator
Joined
Mar 5, 2002
Messages
25,735
Reaction score
1,204
just assign a shortcut key to the program, CRTL + F12 (or whatever you like)

xshortcuttool.png.pagespeed.gp+jp+jw+pj+js+rj+rp+rw+ri+cp+md.ic.KT9pbcvpJj.png


:user:
 
Joined
Nov 17, 2009
Messages
36
Reaction score
2
I think you missed the point - I can make the batchfile, but I can NOT make the batchfile do the 'select NEW'.
 

muckshifter

I'm not weird, I'm a limited edition.
Moderator
Joined
Mar 5, 2002
Messages
25,735
Reaction score
1,204
no, I didn't miss your point ... was merely pointing out that you can call the program up with a couple of key presses.


:user:
 
Joined
Nov 17, 2009
Messages
36
Reaction score
2
The COUPLE of presses is what I am trying to avoid - in Win7, just launching Snippingtool was enough to start capturing an image - apparently this did not get sent when I wrote it, so it now occurs 'out of order'.
 
Joined
Nov 17, 2009
Messages
36
Reaction score
2
I don't think you can do that from the command prompt, but you may be able to create a PowerShell script with "sendkeys" to simulate an ALT+N keypress:

https://technet.microsoft.com/en-us/library/ff731008.aspx

Someone else has sent me code invoking powershell - I am willing to believe his claim that is worked for him, but for me, it just launched snippingtool (the first time only) with the same need to still then click on NEW - so no improvement, but more delay.
The URL above may well have the answer to my wish/fantasy, but is way to complex for ME to apply without much more detailed guidance.
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
Could you please post the code you were sent and I'll see if I can see why that happens :).
 
Joined
Nov 17, 2009
Messages
36
Reaction score
2
First, open Notepad and paste the below PowerShell code into it (tweak the milliseconds sleep to your liking, "50" is very aggressive):

Code:
---------
add-type -AssemblyName microsoft.VisualBasic
add-type -AssemblyName System.Windows.Forms
C:\Windows\System32\SnippingTool.exe
start-sleep -Milliseconds 50
[Microsoft.VisualBasic.Interaction]::AppActivate(“Snipping Tool”)
[System.Windows.Forms.SendKeys]::SendWait(“^{n}”)
---------
Save this file as something like "snipping_tool_workaround.ps1" in your C:\Users\<username>\Documents directory (or where ever you want).

Then create a desktop shortcut with the following (replace "<username>" with your user name or full path, of course):

Code:
---------
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\Users\<username>\Documents\snipping_tool_workaround.ps1"
---------
Name the shortcut whatever you want.

Now when you double-click on that shortcut, the snipping tool opens and defaults to Ctrl-N (a new snip).
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
I've just followed those steps and it works great for me, exactly as you were hoping for :).

If the snipping tool isn't loading quick enough, the keypress might be sent too early to be caught. Could you try changing the "50" value to "300" and see if that delay lets it work for you? If so, you can keep reducing it to something lower.
 
Joined
Nov 17, 2009
Messages
36
Reaction score
2
Forums usually have an option to show satisfaction/gratitude - to say SOLVED, but I can not find it on this webpage.
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
We've got "like" buttons under posts, rather than a "solved" button - but I'm just glad that you've got it fixed :).
 

nivrip

Yorkshire Cruncher
Joined
Mar 21, 2007
Messages
10,855
Reaction score
2,136
I've got the shortcut on the desktop but not sure where to insert the code.
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
I've got the shortcut on the desktop but not sure where to insert the code.

Instead of a shortcut, you need to create a file with a .ps1 extension - for example snipping.ps1. That means that when you run it, it'll be associated with PowerShell (a Windows scripting language). :)
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
Ah sorry, I see what you mean now :). I just used the original .ps1 file to run the script, I thought that's the bit you were stuck on.

I assume that you'll just need to right click the desktop, then click "new shortcut". Then, enter the following for the location:

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\Users\<username>\Documents\snipping_tool_workaround.ps1"

You'll need to change the bit in red to the location you created the file. In Windows 10, it looks like this for me:

Capture.PNG
 

nivrip

Yorkshire Cruncher
Joined
Mar 21, 2007
Messages
10,855
Reaction score
2,136
Thanks, Ian. That's exactly what I did but when I double click the new icon all I get is a small black screen that lasts half a second or so before it disappears.

How do I ensure that it is a .ps1 file? Simply by calling it that?
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
Thanks, Ian. That's exactly what I did but when I double click the new icon all I get is a small black screen that lasts half a second or so before it disappears.

How do I ensure that it is a .ps1 file? Simply by calling it that?

It sounds like the ps1 file isn't launching - can you right click the ps1 file and go to properties and make sure that the filename ends in ps1 (rather than ending in .ps1.txt for example). If that's ok, can you try right clicking the ps1 file and selecting "run with powershell" to see if that is ok?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Snipping tool gone!!! 10
Missing Snipping Tool 6
very odd thing... 8
Snipping Tool 5
Keyboard shortcut for launching snipping tool 2
Windows 10 Windows 10 Is Hiding a Great Video Capture Tool 0
Vista Snipping Tool 4
Snipping Tool not working 1

Top