:: Installs VC++ Runtimes and then CryptoPrevent Bulk. Use on Windows 10 v2004 and 20H2. :: Requires the VC++ 2010 x86 Runtime (vcredist_x86.exe) from here: https://www.microsoft.com/en-us/download/details.aspx?id=26999 :: Rename this file ending in .bat.txt to .bat (removing the .txt) in order to execute! :: EDIT THE LINE BELOW TO CHANGE CryptoPreventSilentBulkSetup.exe TO YOUR ACTUAL SETUP EXE NAME. :: EDIT THE LINE BELOW TO CHANGE CryptoPreventSilentBulkSetup.exe TO YOUR ACTUAL SETUP EXE NAME. :: EDIT THE LINE BELOW TO CHANGE CryptoPreventSilentBulkSetup.exe TO YOUR ACTUAL SETUP EXE NAME. :: @set "CryptoPreventEXE=CryptoPreventSilentBulkSetup.exe" :: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: EDIT THE LINE ABOVE TO CHANGE CryptoPreventSilentBulkSetup.exe TO YOUR ACTUAL SETUP EXE NAME. :: EDIT THE LINE ABOVE TO CHANGE CryptoPreventSilentBulkSetup.exe TO YOUR ACTUAL SETUP EXE NAME :: EDIT THE LINE ABOVE TO CHANGE CryptoPreventSilentBulkSetup.exe TO YOUR ACTUAL SETUP EXE NAME @echo off&title "Fixing CryptoPrevent Bulk Installation..." pushd "%~dp0" if not exist vcredist_x86.exe goto :NoVCRedist if not exist "%CryptoPreventEXE%" goto :NoSetupEXE :: check for admin permissions, returns errorlevel 0 on success (has admin) :: 'fsutil dirty query %systemdrive% >nul 2>&1' only works in XP and above (but NOT in WinPE, use 'net session >nul 2>&1' there) :: but 'net session >nul 2>&1' fails if the 'server' service is not started (e.g. in safe mode, or just broken) but should work :: in WinPE, and also like 'fsutil...' it returns errorlevel 0 on success, but also errorlevel 2 if 'server' service is not started fsutil dirty query %systemdrive% >nul 2>&1 :: :: fail if not errorlevel 0 (success) if %errorlevel% NEQ 0 goto :NoAdmin :: Determine if 64bit paths should be used. Note that by using the syntax '%programfiles% (x86)' and not the single :: '%programfiles(x86)%' then we avoid any errors with the variable not existing and throwing off the actual exist check. :: if "[%programfiles(x86)%]" NEQ "[]" if exist "%programfiles% (x86)" set Win64=True :: if defined Win64 ( set "ProgramDir32=%programfiles(x86)%" ) else ( set "ProgramDir32=%programfiles%" ) :: install VC++ 2010 x86 Runtimes echo Installing the VC++ 2010 x86 Runtimes, please wait... start "" /wait vcredist_x86.exe /passive /norestart :: CryptoPrevent Bulk installation procedure if exist "%ProgramDir32%\Foolish IT\CryptoPrevent\CryptoPrevent.exe" ( set SetupArgs=/silent /norestart /nocloseapplications /suppressmsgboxes ) else ( set SetupArgs=/silent /norestart ) start "" %CryptoPreventEXE% %SetupArgs% :: exit batch goto :eof :NoAdmin echo You must run this batch file as administrator! echo. echo Press any key to exit... pause>nul goto :eof :NoSetupEXE echo Missing '%CryptoPreventEXE%' echo. echo Please rename your installer to the above, echo or edit this batch file to reflect the new name. echo. echo Press any key to exit... pause>nul goto :eof :NoVCRedist echo Missing 'vcredist_x86.exe' echo. echo Please download this file from the URL below and echo place in the same directory as this batch file. echo. echo https://www.microsoft.com/en-us/download/details.aspx?id=26999 echo. echo Press any key to exit... pause>nul goto :eof