• 28 May

    Delete all contents of a destination folder before files are moved

    Q: Is there a way to delete all contents of a destination folder before files are moved/not just overwriting them? I am unzipping a large folder with files daily, most files are named the same thing so they can overwrite them. Have a few that are named with dates and times so they just end up staying in the folder.

    A: If the unzip folder is always the same, the following solution could help you. We added a script that will delete all files and subfolders when ‘On Rule Begin’ is triggered. The path you need to use in the script is the one you will use in your UNZIP as Destination setup.

    – Open Pascal Script Setup

    limagito file mover pascal script

    • Enable and Add the following ‘On Rule Begin’ Pascal Script. In this example our Unzip path = C:\Test\Out\UNZIP\

    Don’t forget to adjust the ctOutputPath const, must end with a \

      ctOutputPath = 'C:\Test\Out\UNZIP\';
      psExitCode:= 1;
      // ... add your code here
      psLogWrite(1, '', 'Delete Tree: ' + ctOutputPath);
      psDeleteFiles(ctOutputPath, '*.*');
      psDeleteTree(ctOutputPath, True);

    Delete all contents of a destination

    #filetransfer #mft #filemanagement

    If you need any info  about this ‘Delete all contents of a destination’ request, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team Pascal Script WIN ZIP ,
  • 10 Feb

    Move and change content of a txt-file

    Q: Hello Limagito, Now I need your help again…

    I got a TXT-file delivered from my customer with approximately 250 rows.

    In the txt file I like “search and replace” a text string :


    Should be replaced with


    And the string


    Should be replaced with


    I also tried to set the powershell exe file in the field for Application name (C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe)

    Is there any other way?

    A: Yes there is, we can do this easily with our Pascal Script so no need for external scripts if you want.

    In our example we’ll use a Windows folder as Source:

    Limagito File Mover WIN as Source

    We only want to handle .txt file so we added the following Filename Include Filter:

    Limagito File Mover Include Filename Filter

    As Destination we added a Pascal Script. This script will does the work you requested.

    Limagito File Mover Pascal Script as Destination

    • Adjust ctOutputPath > must end with a \
    • Encoding of destination text file can be adjusted


      tmpFileIn, tmpFileOut: String;
      tmpList: TStringList;
      ctOutputPath = 'C:\Test\Out_Txt\';
      // Init var
      psExitCode:= 0;
      tmpFileIn := psFilePath + psFileName;
      tmpFileOut := ctOutputPath + psFileName; 
      // ... add your code here
      tmpList := TStringList.Create;
          tmpList.Text := psStringReplace(tmpList.Text, ';19;18;;', ';36;35;;');
          tmpList.Text := psStringReplace(tmpList.Text, ';21;21;;', ';37;37;;');
          If psSaveTxt2File(tmpList.Text, ctOutputPath + psFileName, 'ISO-8859-1', False) Then
            psExitCode := 1;
            psLogWrite(1, '', 'SaveToFile ' + tmpFileOut + ' Successful');    
            psLogWrite(1, '', 'SaveToFile ' + tmpFileOut + ' Error');
          psLogWrite(1, '', 'LoadFromFile ' + tmpFileIn + ' Exception');

    Limagito File Mover Pascal Script as Destination

    Feedback Customer:

    As always you save the day! The Pascal script did my work easily. Some day I have to learn more about pascal!

    I cheat some in powershell and some visual basic, but this stuff is powerful!

    By the way, it only worked in the newer version of Limagito (I still have some workflows in the old version)

    Thank you for help, quick and accurate, as always!

    #FileTransfer #Encoding

    If you need any info about this ‘change content of a txt-file’ request, please let us know.

    Best regards,

    Limagito Team

  • 09 Feb

    Error code 1265 when Trying to run rules on remote devices via DNS name

    Q: I am having the following error:

    Exception: Error trying to create file handle for ‘example of filename with DNS Source Path’ Error code 1265

    There is no error when using the IP address, but we use rotating ip addresses so that is not a viable solution, could you help me troubleshoot this?

    Error Code 1265

    A: Error codes when using WIN as Source or Destination are Operating System Errors. We are using the same function and procedures as the Windows File Explorer does. This is the first time we received feedback of error code 1265. A Google search returns over 5.000.000 hits.

    Although the ‘Logon As’ user of the Limagito Service was set correctly we could not search in this folder. It did not show any subfolders or files using our ‘Explorer’ in the WIN as Source setup screen.

    Error Code 1265

    We solved the issue by adding the Source Path and an appropriate User Account in our Network Drive option.

    Tools Menu Time > Network Drive

    Network Drive Setup

    #FileTransfer #1265

    If you need any info about this ‘Error Code 1265’, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team WIN
1 2 3 4 7