How to start Snip & Sketch from command line
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.
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
-
Download and install AutoHotkey.
-
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:
-
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. -
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
-
Click Convert.
-
A new self-contained executable file should be generated with the name/path you specified in Step 4:
ex. Ahk2Exe Results
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.