You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在SSIS中通过PKZIPC按自定义顺序解压指定文件

Custom Order File Extraction with PKZIPC in SSIS Process Task

Hey there, let's get your custom-order extraction working with PKZIPC in SSIS. The default alphabetical order isn't what you need, but we can tweak the command arguments to force your preferred sequence. Here's how:

Step 1: Modify the PKZIPC Arguments for Custom Order

Instead of letting PKZIPC extract all files automatically, you'll use the -include flag to explicitly list each file in the exact order you want them extracted. Each file gets its own -include parameter, which tells PKZIPC to process them in that sequence.

Example Custom Argument String

If you need to extract priority_report.csv first, then customer_data.xlsx, and finally archive_log.txt, your Arguments field would look like this:

-extract -overwrite -include "priority_report.csv" -include "customer_data.xlsx" -include "archive_log.txt" "C:\MyFolder\xyz.tar.gz" "c:\MyFolder"

Key Notes for the Command:

  • Make sure the filenames match exactly what's inside the xyz.tar.gz (including case sensitivity if your system enforces it).
  • If files are nested in subdirectories within the archive, include the full relative path, e.g., -include "docs/archive_log.txt".
  • Keep using -overwrite to replace existing files as you did before.

Step 2: Update the SSIS Process Task

  1. Open your existing Process Task in SSIS.
  2. Leave the Executable field unchanged: c:\Program Files\PKWARE\PKZIPC\pkzipc.exe
  3. Replace the Arguments field with your custom string from Step 1.

Handling Large Numbers of Files

If you have dozens of files to list, the Arguments field might hit SSIS's length limit. In that case, create a batch file instead:

  1. Create a new .bat file (e.g., ExtractCustomOrder.bat) with this content:
    "c:\Program Files\PKWARE\PKZIPC\pkzipc.exe" -extract -overwrite -include "priority_report.csv" -include "customer_data.xlsx" -include "archive_log.txt" "C:\MyFolder\xyz.tar.gz" "c:\MyFolder"
    
  2. In your SSIS Process Task:
    • Set Executable to cmd.exe
    • Set Arguments to /c "C:\Path\To\Your\ExtractCustomOrder.bat" (replace the path with where you saved the batch file)

Verify the Order

Test the task to confirm files are extracted in your desired sequence. PKZIPC processes each -include entry in the order you write them, so your custom sequence should work as expected.

内容的提问来源于stack exchange,提问作者Nick

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 09:06:06