@echo off
rem $Header: /home/cvs/src/prj/rms/windows.bat,v 1.7 2024/10/08 10:01:41 ralph Exp $

rem ===================================================================================
rem This example batch file assumes that RMS is already installed and is
rem 1a) in the current directory
rem or
rem 1b) rms executable and databases (virscan.*) are reachable via PATH=....
rem 2) A decent windows version with wmic available and you have Administrator rights
rem ===================================================================================


setlocal enabledelayedexpansion


for /f "skip=1 tokens=1" %%a in ('wmic logicaldisk get deviceid') do (

	set "_DRIVE.LETTERS.USED=!_DRIVE.LETTERS.USED!%%a "

)

@REM Under Windows 32bit or 64bit?   x86/AMD64  -- http://support.microsoft.com/kb/556009
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set exe=rms.exe || set exe=rms64.exe

@REM if "%PROCESSOR_ARCHITECTURE%" EQU "AMD64" (
@REM     set "exe=rms64.exe"
@REM ) else (
@REM     set "exe=rms.exe"
@REM )

move rms.log rms_old.log > nul
echo [Info]: Scanning now %_DRIVE.LETTERS.USED% with %exe%
%exe% %_DRIVE.LETTERS.USED% -log -copy -xdir="C:\$WinREAgent,C:\$Recycle.Bin,C:\PerfLogs" %1 %2 %3 %4 %5

rem we need a newline here/25.06.2024/v1.5/1.6
echo.
echo [Info]: All Done! Returncode is=%ERRORLEVEL%
