Skip to content

Instantly share code, notes, and snippets.

@PureOcean
Last active June 12, 2021 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PureOcean/02735e05ed1dbe8e8030830e1e4cea71 to your computer and use it in GitHub Desktop.
Save PureOcean/02735e05ed1dbe8e8030830e1e4cea71 to your computer and use it in GitHub Desktop.
Pin To Start (Limitless) for the "Send To" context menu
@echo off
:: Pin To Start (Limitless) for the "Send To" context menu (by PureOcean, 2021-06-12)
:: This BAT file copies itself to the SendTo folder, thus creating any file to click in the Send To context menu as a shortcut to the Start Menu\Programs. Even .BAT/.CMD files that Windows doesn't support (That's why it was prepared).
IF EXIST "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\SendTo\%~nx0" (GOTO :PinToStart) ELSE (Copy "%~nx0" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\SendTo\%~nx0" /y > nul && Echo %~nx0 added to the "Send To" context menu. && pause > nul && exit /b)
:PinToStart
powershell "$s=(New-Object -COM WScript.Shell).CreateShortcut('%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\%~n1.lnk');$s.TargetPath='%~f1';$s.WorkingDirectory='%cd%';$s.Save()"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment