Page 1 of 1
monitor a folder and unzip files
Posted: Thu Apr 26, 2007 12:32 pm
by robohobo
Hi all, I want to monitor a folder and unzip the archive files as they come in from FTP how can this be done with this software?I tried myself but i keep getting errors.PS i'm not a natural programmer more of a graphic designer.
monitor a folder and unzip files
Posted: Fri Apr 27, 2007 12:35 am
by Oleg
Probably the task tries to unzip file that not has been downloaded completely yet.
Try to insert "Wait for file" action before unzipping. This action will wait until the downloading has finished.
monitor a folder and unzip files
Posted: Fri Apr 27, 2007 1:07 am
by robohobo
Thanks for the reply, I was testing it on a downloaded file. I created a folder called 'Zipped files' I then set robotask to monitor the folder for new files, if it found a *.zip file it should unzip it. I have since found out that this program can only deal with .zip files, thats very limiting, unfortunately people send me archive files in various forms; including .rar, .ace etc. in fact the majority of files are .rar because of better compression over .zip files. I start the task a then drop a zip file into the folder, the task runs then...This is what I get in my log:I: 27/04/2007 10:01:36: ****** Starting task... ******************I: 27/04/2007 10:01:36: Task started with priority: NormalI: 27/04/2007 10:01:36: Executing "Extract Files"I: 27/04/2007 10:01:36: Input file does not existE: 27/04/2007 10:01:36: Probably bad archive (List index out of bounds (1))E: 27/04/2007 10:01:36: An error occured. Step #0 (Extract Files).E: 27/04/2007 10:01:36: Task execution is abortedThere is nothing wrong with the file and I can unzip it. I think it doesn't like winrar; if thats the program its trying to use to unzip the file, else its windows proprietry extract utility, but that works too. I think its the logic side i'm getting wrong and i ain't into logic
monitor a folder and unzip files
Posted: Fri Apr 27, 2007 1:12 am
by robohobo
here is the task file:;**********************;* RoboTask Task file *;* Do not edit! *;********************** [Root]ActionAfterRun=INTEGER|0Actions=FOLDERAutomat=INTEGER|-1CatID=INTEGER|1981091247ContinueOnError=INTEGER|0Events=FOLDERExternalName=STRING|"Task2"Hide=INTEGER|0ID=INTEGER|1879346195Name=STRING|"Extract Files..."Priority=INTEGER|3RunOnClose=INTEGER|0RunOnStartup=INTEGER|0ToLog=INTEGER|3[Actions]Action1=FOLDER[Actions\Action1]ActionID=STRING|"A_ZIP_EXTRACT"Enabled=INTEGER|-1Name=STRING|"Extract Files"Params=FOLDER[Actions\Action1\Params]destdir=STRING|"C:\Documents and Settings\Lee\Desktop\zip folder"filetounzip=STRING|"*.zip"overwrite=STRING|"0"password=STRING|"2488926474257142545418538"skipolderfiles=STRING|"0"unzipfiles=STRING|"*.*"usefoldernames=STRING|"0"[Events]Event1=FOLDER[Events\Event1]Enabled=INTEGER|-1EventID=STRING|"E_FILE_MONITOR"Params=FOLDER[Events\Event1\Params]chg=STRING|"0"chga=STRING|"1"chgsl=STRING|"1"chgsm=STRING|"1"chgtl=STRING|"1"chgtm=STRING|"1"del=STRING|"0"folder1=STRING|"C:\Documents and Settings\Lee\Desktop"foldercount=STRING|"1"id=STRING|"BTUOYWWF1"incmask=STRING|"*.*"interval=STRING|"60"listmode=STRING|"1"mon_files=STRING|"1"mon_folders=STRING|"0"new=STRING|"1"saveresults=STRING|"0"subfolders1=STRING|"1"
monitor a folder and unzip files
Posted: Fri Apr 27, 2007 2:12 am
by Oleg
For more compatibility you can use external utility, such as WinRAR. It supports command line parameters and most popular formats of packed files.
See "Run program/Open document" action.
monitor a folder and unzip files
Posted: Sun Sep 07, 2008 9:54 am
by Aster
I'm having the same confusion. I want to simply have Robotask monitor a folder and, if it finds a .zip file, unzip it.So, for instance I have a .zip file in a folder called "Test" on my desktop. I have tried using the Extract files action, with the "File to Unzip" pointing toC:\Documents and Settings\R\Desktop\Test\*.zipand the destination folder set toC:\Documents and Settings\R\Desktop\Test\and the "files to unzip" set to*.*However, when I run the task, it gives me:I: 9/7/2008 1:43:32 PM: Executing "Extract Files"I: 9/7/2008 1:43:32 PM: Input file does not existE: 9/7/2008 1:43:32 PM: Probably bad archive (List index out of bounds (1))E: 9/7/2008 1:43:32 PM: An error occured. Step #0 (Extract Files).Am I setting the task up wrong?
monitor a folder and unzip files
Posted: Mon Sep 08, 2008 3:46 am
by Oleg
In order to unpack file you have to use the file name (not the mask)
If you want to unpack many files, or you don't know the filename beforehand you may use file loop
File Loop // by *.zip files
Extract Files //from current file
End Loop
monitor a folder and unzip files
Posted: Mon Sep 08, 2008 3:07 pm
by Aster
Got it, thanks Oleg!It took a bit of headscratching because I don't know much more than the basic logic behind coding, but I figured it out. To help anyone who comes by wondering how to do this (like me!), I'll give the elaboration on Oleg's suggestion:First action:File Loop --Parameters: ---Loop Kind: by files only---Search in: whatever directory you want to monitor, and use a wildcard so it looks for zip files (for me: C:\Documents and Settings\R\Desktop\Test\*.zip)---Assign Current Filename to Variable: UNZIPMESecond action: Extract Files--Parameters: ---File to Unzip: {UNZIPME}---Destination Folder: wherever you want the files unzipped to.---Files to Unzip: *.*Third action: End LoopFourth action: Remove variable "UNZIPME"
monitor a folder and unzip files
Posted: Fri Jun 18, 2010 2:07 am
by WouterVK
Hey Aster,
when I use your actions, robotask just unpacks ONE file. No errors, but the other files stay unzipped.

monitor a folder and unzip files
Posted: Fri Jun 18, 2010 4:00 am
by Aster
I forget whether I tried more than one file when I was
testing this. Usually I only get a .zip in a blue moon,
so maybe I didn't catch that one.
Some thoughts, though: if you specifically run the
program on the folder again, does it then find another
.zip file in the folder and unpack that one? Maybe it's
only running one pass of the commands and not searching
again after it's finished? Perhaps an action needs to be
put onto the end to run it again if there are still files
in the folder or somesuch. Something akin to the If/then
loop set up
here?
Unfortunately, since then I've switched computers and
lost the full Robotask, so I don't have all the options
anymore (like file loop).

So you'll be on your own
for actual testing...