Scan files/folder CLI
The MetaDefender Endpoint CLI can be run from the command line to scan files/folders with the options as described in the below table.
The CLI executable is mdcl-cli.exe found at the root of your installation directory of MetaDefender Endpoint
Or download standalone executable here
Example
C:\Program Files (x86)\OPSWAT\GEARS Client\mdcl-cli.exe [<option>=<value>]
Command Line Options
A list of available command line options is also available by running the MetaDefender Endpoint executable from the command line without any options
1 | Option | Value Types | Example(s) | Comments |
---|---|---|---|---|
2 | server | <standard url> | -server= http://127.0.0.1:8008/ | Specifies the URL of the MetaDefender server to be used |
3 | rule | String | -rule=Client | Specifies the MetaDefender security rule to process files |
4 | apikey | String | -apikey=13e5f8h4r3s | Specifies the MetaDefender apikey |
5 | workflow | String | -workflow=Client | Specifies the MetaDefender workflow profile to process files |
6 | verbose | n/a | -verbose | Enables verbose logging of scans. |
7 | user_agent | String | -user_agent=Client | Specifies the value of user_agent that will be provided to MetaDefender |
8 | scan_type | A list of one or more of the following strings
| -scan_type= "system| process| physical| removable| remote" -scan_type= "process|physical| removable" -scan_type=process | Indicates which type of scans MetaDefender Endpoint should do
Note: Any invalid parameters will be ignored with a warning |
9 | scan_location | "C:\somedir | C:\somefile" | -scan_location= "c:\somedir with space| c:\somefile" | Specifies the location of the files and/or directories to be scanned Note: A trailing \ is needed for directories**__Note: invalid or malformed paths will be ignored** |
10 | exclude_drive | E:|F: | -exclude_drive=”E:|F:” | Excludes from the scan *Only drive letters supported currently |
11 | report_dir | Directory Path | -report_dir= "%AppData%\logs" | Specifies the location where scan logs should be saved. If this option is not specified no log file will be generated. |
12 | report_type | One or more of the following strings
| -report_type=”csv|pdf” | Specifies which type of log file to write out at the end of scan. Note: Defaults to txt if option is not specified or option is unavailable |
13 | max_file_size | <val>[GB|G|MB|M|KB|K] | -max_file_size=512KB | Specifies the maximum size of files for which MetaDefender Endpoint will process with MetaDefender Note: Any file greater than the max file size will display "Exceeded File Size" |
14 | gen_config_file | n/a | -gen_config_file | Generate a config.json file in C:\ProgramData\OPSWAT\MetaDefenderClient\settings with default options Note:
|
15 | thread_count | Number | -thread_count=3 | Specify parallelism factor - maximum number of files will be scanned in concurrently |
16 | disable_hash_check | boolean | disable_hash_check= true | Specifies to skip performing a hash check on file(s) in the current scan when set to 'true' Note: A value of 'false' indicates default behavior (i.e. hash check will be enabled) |
17 | process_priority | One of the following strings
| -process_priority=high | Specifies users to change the priority |