Introduction
...
To be able You need to write a custom script to append additional options , (e.g. -Scan) to the virus scanner full path, you will be required to write a custom script in order to be place in the Attachment Checker Virus Scanner configurations.
Finding
...
shortened path for a directory
For Windows environment, if your file path contains spaces (e.g. C:\Program Files), you are able need to use cmd to find the short shortened path for the directory (e.g. c:\progra~1) to remove the spaces.
- Open cmd
- Navigate to desired directory
Execute the following command
Code Block dir /x
The short hand shorthand for the directory would be displayed
...
For Windows Defender, the command line scanner file requires additional options in order to perform a custom an on-demand scan for a specific file.
Create a custom script with batch file script (e.g. c:\atlassian\atlassian-jira-software-7.8.1-standalone\bin\scanner.cmd) using the following template
Info Replace "c:\progra~1\window~1\MpCmdRun.exe -Scan -ScanType -File" with your scanner full path with optionsaccordingly
Save the script as a .cmd fileCode Block title scanner.cmd @echo off REM echo executing scan for file %1 c:\progra~1\window~1\MpCmdRun.exe -Scan -ScanType 3 -File "%1" echo "returning errorLevel = " %ERRORLEVEL% REM exit the script by the exit code from MpCmdRun.exe but do not exit the cmd.exe EXIT /B %ERRORLEVEL%
- Append the path of the script to the Attachment Checker Virus Scanning configurations in the Full Path for Scanner field
Notes
Command | Parameter | Description | References |
---|---|---|---|
MpCmdRun.exe | -Scan -ScanType 3 | Define the type of scan to be executed 0 - Default, according to the configuration 1 - Quick scan 2 - Full System Scan 3 - File and directory custom scan | https://superuser.com/questions/481862/how-can-you-scan-from-the-command-line-with-windows-defender |
-File "%1" | Indicates the file or directory to be scanned. Only valid for custom scans. | ||
Exit | /B | Only exit the script. Do not exit the cmd.exe | https://ss64.com/nt/exit.html |
%ERRORLEVEL% | Exit with the status code given by the previous executed command |