Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

  1. Open cmd
  2. Navigate to desired directory
  3. Execute the following command

    Code Block
    dir /x


  4. 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.

  1. 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


    Code Block
    titlescanner.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%
    Save the script as a .cmd file


  2. Append the path of the script to the Attachment Checker Virus Scanning configurations in the Full Path for Scanner field
    Image Removed
    Image Added

Notes

CommandParameterDescriptionReferences
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/BOnly 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