Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Shell 

Add "Run with priority" to Context Menu

Add Run with priority to the context menu of .exe files to change the process priority of applications for processor resources in Windows 10.


Code
:: Add Run with priority to the context menu of .exe files to change the process priority of applications for processor resources in Windows 10.


@Echo Off & Cls

net sess>nul 2>&1||(powershell start cmd -ArgumentList """/c %~0""" -verb Runas & exit

Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo          Add "Run with priority" to Context Menu (Y/N)?  
Echo.      
Echo.
Echo.


Set /p input= RESPONSE:

If /i  Not %input%==Y (Goto :_Ex) Else (Goto :_Start)

:_Ex
If /i Not %input%==N  (Goto :EOF) Else (Goto :_RegRestore)



:_Start

Reg.exe add "HKCR\exefile\shell\Priority" /v "MUIVerb" /t REG_SZ /d "Run with priority" /f  >Nul
Reg.exe add "HKCR\exefile\shell\Priority" /v "SubCommands" /t REG_SZ /d "" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\001flyout" /ve /t REG_SZ /d "Realtime" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\001flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /Realtime \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\002flyout" /ve /t REG_SZ /d "High" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\002flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /High \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\003flyout" /ve /t REG_SZ /d "Above normal" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\003flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /AboveNormal \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\004flyout" /ve /t REG_SZ /d "Normal" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\004flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /Normal \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\005flyout" /ve /t REG_SZ /d "Below normal" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\005flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /BelowNormal \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\006flyout" /ve /t REG_SZ /d "Low" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\006flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /Low \"%%1\"" /f  >Nul


Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo            Adding "Run with priority" to Context Menu
Echo.
Echo.
Echo.
Ping -n 6 localhost >Nul
Exit


:_RegRestore

Reg.exe delete "HKCR\exefile\shell\Priority" /f >Nul



Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo        Removing "Run with priority" from Context Menu  
Echo.
Echo.
Echo.
Ping -n 6 localhost >Nul
Exit
This didnt work for me the CMD wouldnt open when I clicked it.
[Image: signature.png]
(May 30, 2020 04:28 AM)Crimin4L Wrote:  This didnt work for me the CMD wouldnt open when I clicked it.
Make sure there is no space name of the batch script name it as Run_with_priority.bat
(May 30, 2020 05:08 AM)Emre_ Wrote:  Make sure there is no space name of the batch script name it as Run_with_priority.bat

Yea nada, opens for a millisecond and then closes
[Image: signature.png]
Oh my bad here is the new script.


Code
:: Add Run with priority to the context menu of .exe files to change the process priority of applications for processor resources in Windows 10.


@Echo Off & Cls

(Net session >nul 2>&1)||(PowerShell start """%~0""" -verb RunAs & Exit /B)

Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo          Add "Run with priority" to Context Menu (Y/N)?  
Echo.      
Echo.
Echo.


Set /p input= RESPONSE:

If /i  Not %input%==Y (Goto :_Ex) Else (Goto :_Start)

:_Ex
If /i Not %input%==N  (Goto :EOF) Else (Goto :_RegRestore)



:_Start

Reg.exe add "HKCR\exefile\shell\Priority" /v "MUIVerb" /t REG_SZ /d "Run with priority" /f  >Nul
Reg.exe add "HKCR\exefile\shell\Priority" /v "SubCommands" /t REG_SZ /d "" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\001flyout" /ve /t REG_SZ /d "Realtime" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\001flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /Realtime \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\002flyout" /ve /t REG_SZ /d "High" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\002flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /High \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\003flyout" /ve /t REG_SZ /d "Above normal" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\003flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /AboveNormal \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\004flyout" /ve /t REG_SZ /d "Normal" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\004flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /Normal \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\005flyout" /ve /t REG_SZ /d "Below normal" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\005flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /BelowNormal \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\006flyout" /ve /t REG_SZ /d "Low" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\006flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /Low \"%%1\"" /f  >Nul


Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo            Adding "Run with priority" to Context Menu
Echo.
Echo.
Echo.
Ping -n 6 localhost >Nul
Exit


:_RegRestore

Reg.exe delete "HKCR\exefile\shell\Priority" /f >Nul



Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo        Removing "Run with priority" from Context Menu  
Echo.
Echo.
Echo.
Ping -n 6 localhost >Nul
Exit
Oh my bad here is the new script.


Code
:: Add Run with priority to the context menu of .exe files to change the process priority of applications for processor resources in Windows 10.


@Echo Off & Cls

(Net session >nul 2>&1)||(PowerShell start """%~0""" -verb RunAs & Exit /B)

Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo          Add "Run with priority" to Context Menu (Y/N)?  
Echo.      
Echo.
Echo.


Set /p input= RESPONSE:

If /i  Not %input%==Y (Goto :_Ex) Else (Goto :_Start)

:_Ex
If /i Not %input%==N  (Goto :EOF) Else (Goto :_RegRestore)



:_Start

Reg.exe add "HKCR\exefile\shell\Priority" /v "MUIVerb" /t REG_SZ /d "Run with priority" /f  >Nul
Reg.exe add "HKCR\exefile\shell\Priority" /v "SubCommands" /t REG_SZ /d "" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\001flyout" /ve /t REG_SZ /d "Realtime" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\001flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /Realtime \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\002flyout" /ve /t REG_SZ /d "High" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\002flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /High \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\003flyout" /ve /t REG_SZ /d "Above normal" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\003flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /AboveNormal \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\004flyout" /ve /t REG_SZ /d "Normal" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\004flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /Normal \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\005flyout" /ve /t REG_SZ /d "Below normal" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\005flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /BelowNormal \"%%1\"" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\006flyout" /ve /t REG_SZ /d "Low" /f  >Nul
Reg.exe add "HKCR\exefile\Shell\Priority\shell\006flyout\command" /ve /t REG_SZ /d "cmd.exe /c start \"\" /Low \"%%1\"" /f  >Nul


Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo            Adding "Run with priority" to Context Menu
Echo.
Echo.
Echo.
Ping -n 6 localhost >Nul
Exit


:_RegRestore

Reg.exe delete "HKCR\exefile\shell\Priority" /f >Nul



Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo        Removing "Run with priority" from Context Menu  
Echo.
Echo.
Echo.
Ping -n 6 localhost >Nul
Exit


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by iRazorOct 15, 2021 12:35 PM 3 155 Oct 15, 2021 12:35 PM
Last Post: steel iron
[Shell] by Emre_May 28, 2020 09:36 PM 0 114 May 28, 2020 09:36 PM
Last Post: Emre_
[C] by SмℯґƒMay 11, 2020 04:01 PM 0 135 May 11, 2020 04:01 PM
Last Post: Sмℯґƒ