1

I would like to call Snip & Sketch with a Logitech mouse button. The Logitech app expects a path to an executable to do so. How do I do that for Snip & Sketch?

Moeller
  • 11

5 Answers5

3

I would like to call Snip & Sketch with a Logitech mouse button. The Logitech app expects a path to an executable to do so. How do I do that for Snip & Sketch?

Building off of harrymc's answer, one approach might be to wrap:

explorer ms-screenclip:

in a self-contained executable file with AutoHotkey. You could then try feeding that executable to the Logitech launcher. I am honestly unsure if this would yield similar results to the .vbs solution you already noted you were having issues with, but it might be worth a try.

Wrapping Snip & Sketch with AutoHotkey

  1. Download and install AutoHotkey.

  2. Create a new .ahk script. These are just plain text files with an .ahk extension. Place the following line inside the file:

ex. Contents of illogical.ahk

   Run explorer ms-screenclip:
  1. From the Windows Start Menu, browse to the AutoHotkey folder and select the shortcut marked Convert .ahk to .exe. This will invoke Ahk2Exe.exe, which should have been installed in Step 1.

  2. In the Ahk2Exe.exe interface, click Browse to specify the path to your script. Repeat for the desired output (.exe) file name/path and any optional icon file you wish to use:

ex. Ahk2Exe Interface

Ahk2Exe - Interface - Screenshot

  1. Click Convert.

  2. A new self-contained executable file should be generated with the name/path you specified in Step 4:

ex. Ahk2Exe Results

Ahk2Exe - Results - Screenshot


Notes

  • Any original script or icon files do not need to be kept with the final executable.

  • The AutoHotkey Run command does not generate a visible command window.

  • Under Windows 10, Windows Defender will scan the resulting executable file the first time it is run.

  • After running the executable, there might be a short delay before the Windows 10 Snip & Sketch screenshot tools appear (i.e. the Rectangular, Freeform, Window and Fullscreen Snip options).

  • For reference, Ahk2Exe.exe currently resides under the Compiler folder in the main AutoHotkey installation directory.

Anaksunaman
  • 18,227
2

You may start Snip & Sketch with the following command:

explorer ms-screenclip:

If the Logitech app cannot accept a command-line, only an executable name, you may put this command in a .bat file and pass its path to the Logitech app.

This will cause the Command Prompt to appear briefly on the screen as a black rectangle. If this bothers you, see the post Run a batch file in a completely hidden way.

harrymc
  • 498,455
0

Because it's a store app, it doesn't have a 'classic' path like C:\program files\microsoft\snip and sketch\, it has a path like this C:\Program Files\WindowsApps\Microsoft.ScreenSketch_10.2008.2277.0_x64__8wekyb3d8bbwe which isn't static. The path will change as the app updates, and the hex string at the end is likely randomly generated as a hash of some sort.

As a workaround, you could take a copy of the folder and put it in something like c:\tools\snip\ but it's a bit hacky.

As John has suggested, it may be more sensible to leverage the PrtScn option.

0

I had the same problem with X-MOUSE using the RUN command option, bound to a mouse key, it works for me using ms-screenclip: as the filepath

Matt
  • 1
0

It is not advisable to start a fresh explorer.exe for each instance of snipping tool. Instead you can write a small VBScript file like below and use it.

Dim oWsh : Set oWsh = CreateObject("WScript.Shell")
oWsh.Run "ms-screenclip:"

You can adopt the above code to so many other languages or just save the above two lines to a file with .vbs extension. If you want to invoke (I mean run) this file with a keyboard shortcut, just create a regular shortcut file to this vbs file and you can set the required key combination in the properties of shortcut file. Hope this helps someone.