button - add to Schtasks

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
KozakMak
Senior Member
Senior Member
Posts: 370
Joined: 2021-05-24, 12:39 UTC
Location: UA

button - add to Schtasks

Post by *KozakMak »

So i have this .reg file:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\SystemFileAssociations\.exe\Shell\AddSchtasks]
@="AddSchtasks"
"icon"="shell32.dll,-21"
"Position"="Bottom"
 
[HKEY_CLASSES_ROOT\SystemFileAssociations\.exe\Shell\AddSchtasks\command]
@="cmd /D /C (mode 20,1 & for /F \"Tokens=2,*\" %%i in ('REG QUERY \"HKCR\\SystemFileAssociations\\.exe\\Shell\\AddSchtasks\\command\" /V execute') do set \"$$=%1\" && cmd /D /C %%j)"
"execute"="for /F \"Tokens=*\" %i in (\"%$$%\") do (schtasks /Create /TN \"WithoutUAC %~ni\" /TR \"'%~i'\" /F /SC ONLOGON /RL HIGHEST) >nul 2>&1"
What it does - add a command to the files context menu, that adds the exe to the scheduler to run with elevated rights without prompting

:?: Question is how can this be done with a button in TC?

thx
OS: Win10 | TC: latest x64
Post Reply