Zip ONLY files in a folder

Discuss RoboTask here
Post Reply
marcolobaido
Posts: 70
Joined: Thu Jul 02, 2015 3:54 pm

Zip ONLY files in a folder

Post by marcolobaido »

Hi, I used the "pack files" command to create a zip file of a certain number of files in this folder: C:\Users\Notebook\Dropbox\Cartsan\documenti\{DITTA_ELENCO_S_P}\{ANNO_NOMINA}\1 Documentazione Sanitaria {DITTA_ELENCO} {ANNO_NOMINA}\copiaDatore\*.*

If I manually unzip the archive in Desktop and I open it, I find all these folders: users, notebook, dropbox, cartsan....etc and at least my files inside "copiaDatore" folder.

I'd like to create an archive with only files.

Code: Select all

[General]
ActionId=A_ZIP_PACK
Name=Pack Files
Enabled=-1
[Params]
filecount=1
file0=C:\Users\Notebook\Dropbox\Cartsan\documenti\{DITTA_ELENCO_S_P}\{ANNO_NOMINA}\1 Documentazione Sanitaria {DITTA_ELENCO} {ANNO_NOMINA}\copiaDatore\*.*
destfile=C:\Users\Notebook\Dropbox\Cartsan\documenti\{DITTA_ELENCO_S_P}\{ANNO_NOMINA}\1 Documentazione Sanitaria {DITTA_ELENCO} {ANNO_NOMINA}\copiaDatore\copiaDatore.rar
comentcount=2
coment0={DateTime}, {DayOfWeek}
coment1=This zip-archive created by RoboTask (C) 2003-2015 Neowise
action=3
compreslevel=1
dosformat=0
includesubfolders=0
incsysandhidden=0
junkdirnames=0
passwordmode=0
password=2668125708269892468812396
marcolobaido
Posts: 70
Joined: Thu Jul 02, 2015 3:54 pm

Re: Zip ONLY files in a folder

Post by marcolobaido »

Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Zip ONLY files in a folder

Post by Oleg »

You have to make two steps
1 Change folder to

Code: Select all

C:\Users\Notebook\Dropbox\Cartsan\documenti\{DITTA_ELENCO_S_P}\{ANNO_NOMINA}\1 Documentazione Sanitaria {DITTA_ELENCO} {ANNO_NOMINA}\copiaDatore
2 Pack files by mask *.*

In this case you will pack only files without folder structure

See my example below:

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|444033236
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task24"
Hide=INTEGER|0
ID=INTEGER|1434512155
LogOnAsUser=INTEGER|1
Name=STRING|"pack files"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER

[Actions\Action1]
ActionID=STRING|"A_FOLDER_CHANGE"
Enabled=INTEGER|-1
Name=STRING|"Change Folder (C:\Users\Notebook\Dropbox\Cartsan\documenti\{DITTA_ELENCO_S_P}\{ANNO_NOMINA}\1 Documentazione Sanitaria {DITTA_ELENCO} {ANNO_NOMINA}\copiaDatore)"
Params=FOLDER

[Actions\Action1\Params]
folder=STRING|"C:\Users\Notebook\Dropbox\Cartsan\documenti\{DITTA_ELENCO_S_P}\{ANNO_NOMINA}\1 Documentazione Sanitaria {DITTA_ELENCO} {ANNO_NOMINA}\copiaDatore"

[Actions\Action2]
ActionID=STRING|"A_ZIP_PACK"
Enabled=INTEGER|-1
Name=STRING|"Pack Files"
Params=FOLDER

[Actions\Action2\Params]
action=STRING|"3"
coment0=STRING|"{DateTime}, {DayOfWeek}"
coment1=STRING|"This zip-archive created by RoboTask (C) 2003-2015 Neowise"
comentcount=STRING|"2"
compreslevel=STRING|"1"
destfile=STRING|"copiaDatore.rar"
dosformat=STRING|"0"
file0=STRING|"*.*"
filecount=STRING|"1"
includesubfolders=STRING|"0"
incsysandhidden=STRING|"0"
junkdirnames=STRING|"0"
password=STRING|"2514526479269912545524690"
passwordmode=STRING|"0"
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.


BTW: Pack files action makes ZIP archive (not RAR)
Oleg Yershov
Post Reply