How to delete unzipped zip file?

Discuss Task Sequences and Scripting related issues.

How to delete unzipped zip file?

Postby melvin » Wed Nov 20, 2013 9:51 pm

User Support Request:
We have created task to unzip zipped files that are placed within a folder. Is there a manor where after the files is unzipped, that we can move or delete the original zipped file?
I have the files that unzipped being unpacked into a different directory but when we set this to run what will keep the process from unzipping the same files over and over?
melvin
Site Admin
 
Posts: 979
Joined: Thu May 25, 2006 10:20 am
Location: Santa Barbara, california

Re: How to delete unzipped zip file?

Postby melvin » Wed Nov 20, 2013 9:52 pm

The best way to do this is as follows:
1) Create a directory loop task with following settings:
task title = dirLoop
filename = .zip
task to run field = unzip_file|delete_zip
the directory loop task will run these 2 tasks in sequence for every loop. It will also set a variable called dirLoop::CurrentFilename

2) the unzip_file task settings:
task title = unzip_file
zip filename = $%dirLoop::CurrentFilename%$

3) delete_zip task settings:
filename = $%dirLoop::CurrentFilename%$
melvin
Site Admin
 
Posts: 979
Joined: Thu May 25, 2006 10:20 am
Location: Santa Barbara, california


Return to Task Sequences, Chains and Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron