Command

  • 16 Apr

    Microsoft Defender Antivirus Command-Line tool before moving a file

    Q: I would like to use an Antivirus Command-Line tool before moving a file to its Destination. Can you recommend an antivirus scanner that your software can call and scan the file before transmitting?
    A: Since Microsoft Defender Antivirus is installed on latest OS versions we decided to use the command-line version ( mpcmdrun.exe ) of this AV.

    We are using a 64bit Windows 10 and installed the 64bit version of our Limagito File Mover. In this case the 64bit version of our File Mover is a must because the AV Command-Line tool is also 64bit. It will not work otherwise.

    • In the following example the Source is a Windows folder (WIN). Our goal is to transmit some pdf files to an AWSS3 Destination. Before sending the files we want to scan them using the command-line version of Microsoft Defender Antivirus.

    Limagito File Mover Windows folder as Source

    • Open the ‘Function’ setup, important here is that ‘Exit Cyclus on Error’ is selected.

    Limagito File Mover Function Setup

    • Now we are going to add our Destinations. The first Destination must be CMD (Command), the second Destination is where the source file will be moved to if it isn’t infected by a virus.

    Limagito File Mover Destination setup

    • CMD (Command) Setup as First Destination:

    CMD /C ” “%ProgramFiles%\Windows Defender\MpCmdRun.exe” -Scan -ScanType 3 -File “%SFP%SFN” “

    When the AV scan is successful the ExitCode will be 0. All other values will be treaded as an error and will result in the source file not being moved to the second destination due to the ‘Exit Cyclus on Error’ selection in the Function setup.

    Limagito File Mover mpcmdrun.exe command-line tool

    • The second destination is where the source file will be moved to if it isn’t infected by a virus. You can choose this yourself. In our case it is AWSS3.
    • In case the AV returns an error (CMD ExitCode <> 0) then the file will not be moved to its second destination. Now you can add an ‘On Error’ Rule event to warn you.

    Limagito File Mover Rule Events

    • RunTime Log result:

    Limagito File Mover RunTime Log

    #FileTransfer

    If you need any help with this ‘Antivirus Command-Line tool’ request, please let us know.

    Best Regards,

    Limagito Team

  • 10 Mar

    Q&A 41: How to trigger powershell scripts using Limagito File Mover

    Q: We would like to know how to trigger powershell scripts using Limagito.

    A: Please have a look at the example we received from one of our users

    Command Line:

    cmd /c powershell.exe -NoLogo -NonInteractive -file “D:\Scripts\Extract_Logs.ps1”

    Important:

    When using Powershell as Command Line tool, please disable ‘Redirect Command Output to Log’ op (Advanced tab).

    Limagito File Mover Command output to log
    If you need any help with this ‘trigger powershell scripts’ request, please let us know.

    Best Regards,

    Limagito Team

     

    By Limagito-Team Command
  • 11 May

    How-To use a Command Line tool as Source in LimagitoX File Mover

    In this how-to we’ll explain you how-to use a command line tool, aka CMD, as source in LimagitoX File Mover.

    First you need to add a CMD as Source:

    LimagitoX-Command-Line-Tool-as-Source

    The following screenshot shows the CMD setup. In this example we’ll trigger a Ping from the Command Line. The result of the ping is stored in a text file. In this example we’re using a couple of parameters:

    %DFD = Destination File Directory

    %TCD:mmddyyyy-hhnnss: = Time Current Date format YearMonthDay-HourmiNuteSeconds

    cmd /c ping 127.0.0.1 > %DFD\PingCheck.%TCD:mmddyyyy-hhnnss:.txt

    The Destination Directory of the Command result is set to: C:\Test\In\CMD\In\

    Limagito-Command-Line-Tools-As-Source-Setup

    We selected ‘Move’ as function, so files created in the previous CMD Destination Directory will be Moved to its final Destination.

    We added a WIN local folder as Final Destination.

    Result in RuntTime Log:

    Content of ping command result text file:

    If you need help with the Command Line Tool as Source, please let us know.

    Regards,

    Limagito Team

    By Limagito-Team Command ,
1 2 3 4
SEARCH