Advertisement
mrtie

Open With VTFEdit Context Menu

Mar 20th, 2023
1,191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.92 KB | Software | 0 0
  1. @echo off
  2. SETLOCAL EnableDelayedExpansion
  3. for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
  4.   set "DEL=%%a"
  5. )
  6. :start
  7. cls
  8. title Open with VTFEdit Context Menu
  9. echo.
  10. call :ColorText 0c "Make sure this file is in the same folder as VTFEdit.exe and to run as admin"
  11. echo.
  12. echo.
  13. echo 1. Add Open with VTFEdit context menu
  14. echo 2. Remove Open with VTFEdit context menu
  15. echo.
  16. set /p do=
  17. if "%do%"=="1" goto add
  18. if "%do%"=="2" goto remove
  19. goto start
  20. :add
  21. cls
  22. REG add "HKCR\Directory\shell\Open with VTFEdit\command" /d "\"%~dp0\VTFEdit.exe\" \"%%1\""
  23. REG add "HKCR\Directory\shell\Open with VTFEdit" /v icon /d "\"%~dp0\VTFEdit.exe\""
  24. pause
  25. goto start
  26. :remove
  27. cls
  28. REG delete "HKCR\Directory\shell\Open with VTFEdit"
  29. pause
  30. goto start
  31.  
  32.  
  33. goto :eof
  34.  
  35. :ColorText
  36. echo off
  37. <nul set /p ".=%DEL%" > "%~2"
  38. findstr /v /a:%1 /R "^$" "%~2" nul
  39. del "%~2" > nul 2>&1
  40. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement