Skip to content

Extract, archive and trigger completion file

papakillo edited this page Nov 1, 2023 · 2 revisions

The provided script appears to perform a series of file-related operations, including locating, extracting, archiving, and triggering completion of a data processing task. Below is an explanation of the script. Please replace names of folders with your own names.


`for /R "\adub\na" %%I in ("sales**.zip") do ( "C:\Program Files\7-Zip\7z.exe" x -y -o"C:\Wherescape\inbound\data\EU_FILES\sales" "%%~fI" )

move \adub\na\sales_*.zip \adub\eu_folder_Archive\

echo 1 > C:\Wherescape\inbound\data\NA_FILES\sales\complete.trg`


  1. Commented Description:

    • The initial comment lines describe the purpose of the script, indicating it searches the "NA1010" folder for ZIP files matching the pattern "CEU_SALES*.zip".
  2. For Loop with 7-Zip Extraction:

    • It uses a for loop to traverse the directory "\hefsarc01\na1010" and identifies all ZIP files matching the pattern "CEU_SALES*.zip".
    • For each matched ZIP file (%%I), the script utilizes 7-Zip ("C:\Program Files\7-Zip\7z.exe") to extract the files (x command) into the directory "C:\Wherescape\inbound\data\EU_FILES\CEU_SALES".
    • %%~fI represents the full path of the current ZIP file being processed.
  3. Move Command:

    • After extraction, the script uses the move command to relocate the extracted ZIP files matching the pattern "CEU_SALES_*.zip" from the original directory to the archive directory "\hefsarc01\EU1010_Archive".
  4. Trigger File Generation:

    • Finally, it creates a trigger file named "complete.trg" in the directory "C:\Wherescape\inbound\data\NA_FILES\CEU_SALES". The file content is "1", serving as a signal or indicator of the completion of the process.

Clone this wiki locally