100 lines
2.4 KiB
Batchfile
100 lines
2.4 KiB
Batchfile
@ECHO OFF
|
|
TITLE DIGITAL DATA - %~n0
|
|
ECHO -
|
|
ECHO Windows Command Line Script
|
|
ECHO CMD Version %CMDEXTVERSION% active!
|
|
ECHO -
|
|
ECHO Digital Data
|
|
ECHO Ludwig-Rinn-Strasse 16
|
|
ECHO 35452 Heuchelheim
|
|
ECHO Tel.: 0641 / 202360
|
|
ECHO E-Mail: info@didalog.de
|
|
ECHO -
|
|
ECHO Version Number: 1.0.0.0
|
|
ECHO Version Date: 24.02.2019
|
|
|
|
pushd "%~dp0"
|
|
setlocal
|
|
|
|
REM --------------------------------------------------------------
|
|
REM ----------------------- set variables ------------------------
|
|
REM --------------------------------------------------------------
|
|
|
|
SET ScriptName=%~n0
|
|
REM Automatic defined Variable, do not change!
|
|
REM Write WITHOUT double Quotes("")!
|
|
|
|
SET ScriptPath=%~dp0
|
|
REM Automatic defined Variable, do not change!
|
|
REM Write WITHOUT double Quotes("")!
|
|
|
|
SET AntivirusEXE=C:\Program Files (x86)\G DATA\AVKClient\avkcmd.exe
|
|
REM Write the full path and name of the Antivirus commandline Exe
|
|
REM Write WITHOUT double Quotes("")!
|
|
|
|
SET AntivirusLog=%ScriptPath%\%ScriptName%.log
|
|
REM Write WITHOUT double Quotes("")!
|
|
|
|
SET AntivirusCALL=/log: %AntivirusLog% /scan(e0a5): %1
|
|
REM Write WITHOUT double Quotes("")!
|
|
|
|
REM --------------------------------------------------------------
|
|
REM ----------------------- preparing part -----------------------
|
|
REM --------------------------------------------------------------
|
|
|
|
IF NOT EXIST "%AntivirusEXE%" (
|
|
ECHO -
|
|
ECHO Antivirus scanner not found.
|
|
ECHO Exiting because of this Issue!
|
|
GoTo UnplanedExit
|
|
)
|
|
|
|
IF NOT EXIST "%1" (
|
|
ECHO -
|
|
ECHO Argument invalid.
|
|
ECHO Cannot access Mail file.
|
|
ECHO Exiting because of this Issue!
|
|
GoTo UnplanedExit
|
|
)
|
|
|
|
REM --------------------------------------------------------------
|
|
REM ------------------------- main part --------------------------
|
|
REM --------------------------------------------------------------
|
|
|
|
ECHO -
|
|
ECHO Antivirus on Path: "%AntivirusEXE%",
|
|
ECHO is set to scan %1,
|
|
ECHO with Parameter set "%AntivirusCALL%".
|
|
|
|
"%AntivirusEXE%" %AntivirusCALL%
|
|
|
|
ECHO -
|
|
find "# Infected files 1" "%AntivirusLog%"
|
|
|
|
if %errorlevel% == 0 (
|
|
ECHO A Virus was found!
|
|
exit /b 1
|
|
)
|
|
|
|
if %errorlevel% == 1 (
|
|
ECHO No Virus was found!
|
|
exit /b 0
|
|
)
|
|
|
|
REM --------------------------------------------------------------
|
|
REM ----------------------- finishing part -----------------------
|
|
REM --------------------------------------------------------------
|
|
|
|
:UnplanedExit
|
|
endlocal
|
|
ECHO -
|
|
ECHO This Window will close in:
|
|
timeout /T 10
|
|
rem pause
|
|
exit
|
|
|
|
:PlanedExit
|
|
endlocal
|
|
rem pause
|
|
exit
|