Skip to content

Instantly share code, notes, and snippets.

@wincmd64
Last active November 10, 2024 07:02
Show Gist options
  • Save wincmd64/03fb9290512f201ea9b3907449fbf9e3 to your computer and use it in GitHub Desktop.
Save wincmd64/03fb9290512f201ea9b3907449fbf9e3 to your computer and use it in GitHub Desktop.
:: Adds "Emsisoft Scanner" entry to the Explorer context menu
::
:: Installation:
:: 1. Download and unpack: https://www.emsisoft.com/en/commandline-scanner/
:: for x64 -- https://dl.emsisoft.com/EmsisoftCommandlineScanner64.exe
:: for x32 -- https://dl.emsisoft.com/EmsisoftCommandlineScanner32.exe
:: 2. Add the unpacked directory to %PATH%
:: 3. Run this file
@echo off
:: get a2cmd path
for /f "tokens=* delims=" %%a in ('where a2cmd.exe') do set "app=%%a"
if not exist "%app%" (color 4 & echo. & echo a2cmd not found. & echo. & pause & exit) else (TITLE %app%)
del "%temp%\elevatea2cmd.vbs"
echo CreateObject("Shell.Application").ShellExecute "cmd.exe", "/c a2cmd.exe " ^& Chr(34) ^& Wscript.Arguments.Item(0) ^& Chr(34) ^& " /a /pup /cloud=0 & pause", "", "runas", 1 >> "%temp%\elevatea2cmd.vbs"
reg delete "HKCU\Software\Classes\*\shell\AntiMalware" /f
reg delete "HKCU\Software\Classes\Directory\shell\AntiMalware" /f
reg add "HKCU\Software\Classes\*\shell\AntiMalware" /v "MUIVerb" /d "Emsisoft Scanner" /f
reg add "HKCU\Software\Classes\*\shell\AntiMalware" /v "Icon" /d "%app%" /f
reg add "HKCU\Software\Classes\*\shell\AntiMalware\command" /ve /d "WScript.exe \"%temp%\elevatea2cmd.vbs\" \"%%1\"" /f
reg add "HKCU\Software\Classes\Directory\shell\AntiMalware" /v "MUIVerb" /d "Emsisoft Scanner" /f
reg add "HKCU\Software\Classes\Directory\shell\AntiMalware" /v "Icon" /d "%app%" /f
reg add "HKCU\Software\Classes\Directory\shell\AntiMalware\command" /ve /d "WScript.exe \"%temp%\elevatea2cmd.vbs\" \"%%1\"" /f
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment