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?
-
You can assign Snip 'n Sketch to the PrtSc button in Ease of Access (be careful of conflicts). Then it is a single button. Mouse in one hand, push PrtSc with other hand. That will be just as fast. I do not see an command line way to start Snip 'n Sketch. – John Jun 02 '21 at 12:42
4 Answers
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
.ahkscript. These are just plain text files with an.ahkextension. 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.exeinterface, 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.execurrently resides under the Compiler folder in the main AutoHotkey installation directory.
- 16,718
- 4
- 38
- 45
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.
- 455,459
- 31
- 526
- 924
-
Brilliant thanks a lot. Unfortunately, although the BAT trick does it with Logitech's software, the screen readies for screenshot (freezes) with the Command Prompt displayed, and so destroys the utility of the shortcut. The VBS "encapsulation" work great (invisibly) from a Command Prompt, but not from Logitech's software, where it just does not do anything. Why Microsoft? Why this structure? What is there to gain from a user point of view? I know why I hate store systems... – Moeller Jun 02 '21 at 15:13
-
-
Nope. From theCommand Prompt, this brings up an _Open with..._ dialog for the _ms-appx-web_ type. From Logitech's software, nothing happens. But thanks. I guess I'll conform to the store standard (PrtScr Ease of Access setting), like a weakness-user. – Moeller Jun 02 '21 at 15:30
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.
- 8,367
- 2
- 25
- 42
-
I'm barred from executing the program from the folder directly (access denied). Copying the folder some other place on the drive doesn't help, as the program throws a fit looking for libraries. – Moeller Jun 02 '21 at 15:14
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
- 1
-
1Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 31 '22 at 10:05

