Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- SETLOCAL EnableDelayedExpansion
- for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
- set "DEL=%%a"
- )
- :start
- cls
- title Open with VTFEdit Context Menu
- echo.
- call :ColorText 0c "Make sure this file is in the same folder as VTFEdit.exe and to run as admin"
- echo.
- echo.
- echo 1. Add Open with VTFEdit context menu
- echo 2. Remove Open with VTFEdit context menu
- echo.
- set /p do=
- if "%do%"=="1" goto add
- if "%do%"=="2" goto remove
- goto start
- :add
- cls
- REG add "HKCR\Directory\shell\Open with VTFEdit\command" /d "\"%~dp0\VTFEdit.exe\" \"%%1\""
- REG add "HKCR\Directory\shell\Open with VTFEdit" /v icon /d "\"%~dp0\VTFEdit.exe\""
- pause
- goto start
- :remove
- cls
- REG delete "HKCR\Directory\shell\Open with VTFEdit"
- pause
- goto start
- goto :eof
- :ColorText
- echo off
- <nul set /p ".=%DEL%" > "%~2"
- findstr /v /a:%1 /R "^$" "%~2" nul
- del "%~2" > nul 2>&1
- goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement