Zip file directory structure
-
- Posts: 17
- Joined: Sat Oct 22, 2005 12:35 pm
- Location: United Kingdom
Zip file directory structure
How do I just pack the files and not the folders that contain it from the route of the drive.
Zip file directory structure
In order to store directory structure from some folder (not from root) you should do this:
- change current folder to necessary folder;
- pack "*.*" files. Do not specify the full path.
See example below
- change current folder to necessary folder;
- pack "*.*" files. Do not specify the full path.
See example below
Code: Select all
;**********************
;* RoboTask Task file *
;* Do not edit! *
;**********************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1807969784
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task314"
Hide=INTEGER|0
ID=INTEGER|1528195730
Name=STRING|"Pack files from current folder"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
[Actions]
Action1=FOLDER
Action2=FOLDER
[Actions\Action1]
ActionID=STRING|"A_FOLDER_CHANGE"
Enabled=INTEGER|-1
Name=STRING|"Change Folder (C:\Temp\joy\Disk1)"
Params=FOLDER
[Actions\Action1\Params]
folder=STRING|"C:\Temp\joy\Disk1"
[Actions\Action2]
ActionID=STRING|"A_ZIP_PACK"
Enabled=INTEGER|-1
Name=STRING|"Pack Files"
Params=FOLDER
[Actions\Action2\Params]
action=STRING|"0"
coment0=STRING|"{DateTime}, {DayOfWeek}"
coment1=STRING|"This zip-archive created by RoboTask"
comentcount=STRING|"2"
compreslevel=STRING|"1"
destfile=STRING|"c:\testfile.zip"
dosformat=STRING|"0"
file0=STRING|"*.*"
filecount=STRING|"1"
includesubfolders=STRING|"1"
incsysandhidden=STRING|"0"
junkdirnames=STRING|"0"
password=STRING|"2616925963249432699077676"
Zip file directory structure
I am having trouble with a variation of this command. like first user I would like to zip files without the path from root. but I have multiple files in one folder that need to be zipped into their own zip file. in other words. c:\music\ folder contains 12 files. I am trying to make a task that creates a zip file for each file and without the directory structure. I have created a loop command and made that run sucessfully, I have also used the above example successfully. but I am having a hard time combining the two. any suggestions?
thanks, Jmail137
thanks, Jmail137
Zip file directory structure
I figured out a way to do it! here is a sample.
Code: Select all
;**********************
;* RoboTask Task file *
;* Do not edit! *
;**********************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|0
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task5"
Hide=INTEGER|0
ID=INTEGER|585389684
Name=STRING|"loop zip"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|2
[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action14=FOLDER
Action15=FOLDER
Action16=FOLDER
Action17=FOLDER
Action18=FOLDER
Action19=FOLDER
Action2=FOLDER
Action20=FOLDER
Action21=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER
[Actions\Action1]
ActionID=STRING|"A_FOLDER_CREATE"
Enabled=INTEGER|0
Name=STRING|"Create Folder (C:\binaries)"
Params=FOLDER
[Actions\Action1\Params]
newfolder=STRING|"C:\binaries"
[Actions\Action10]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set varible ""F_COUNT"" with value ""0"""
Params=FOLDER
[Actions\Action10\Params]
varname=STRING|"F_COUNT"
varvalue=STRING|"0"
[Actions\Action11]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER
[Actions\Action11\Params]
createmode=STRING|"1"
date1=STRING|"20040323"
date2=STRING|"20040323"
destvar=STRING|"FILENAME"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"{SELECTEDFOLDER}\*.*"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
savevar=STRING|"FILESIZE"
searchkind=STRING|"0"
subdirs=STRING|"0"
timesize=STRING|"0"
WithoutPath=STRING|"1"
[Actions\Action12]
ActionID=STRING|"A_VARIABLES_INCREMENT"
Enabled=INTEGER|-1
Name=STRING|"Increment variable ""F_Count"""
Params=FOLDER
[Actions\Action12\Params]
incement=STRING|"1"
vaiable=STRING|"F_Count"
[Actions\Action13]
ActionID=STRING|"A_FOLDER_CHANGE"
Enabled=INTEGER|-1
Name=STRING|"Change Folder (c:\binaries)"
Params=FOLDER
[Actions\Action13\Params]
folder=STRING|"c:\binaries"
[Actions\Action14]
ActionID=STRING|"A_ZIP_PACK"
Enabled=INTEGER|-1
Name=STRING|"Pack Files"
Params=FOLDER
[Actions\Action14\Params]
action=STRING|"0"
coment0=STRING|"{DateTime}, {DayOfWeek}"
coment1=STRING|"This zip-archive created by RoboTask (C) 2003 Neowise"
comentcount=STRING|"2"
compreslevel=STRING|"1"
destfile=STRING|"{ZIPFOLDER}\{filename}.zip"
dosformat=STRING|"0"
file0=STRING|"{filename}"
filecount=STRING|"1"
includesubfolders=STRING|"0"
incsysandhidden=STRING|"0"
junkdirnames=STRING|"0"
password=STRING|"3923338567377903831739325"
[Actions\Action15]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Actions\Action16]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action17]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 2500 ms"
Params=FOLDER
[Actions\Action17\Params]
delay=STRING|"25"
[Actions\Action18]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""F_COUNT"""
Params=FOLDER
[Actions\Action18\Params]
varname=STRING|"F_COUNT"
[Actions\Action19]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""TOTAL_SIZE"""
Params=FOLDER
[Actions\Action19\Params]
varname=STRING|"TOTAL_SIZE"
[Actions\Action2]
ActionID=STRING|"A_FOLDER_CREATE"
Enabled=INTEGER|0
Name=STRING|"Create Folder (C:\zip)"
Params=FOLDER
[Actions\Action2\Params]
newfolder=STRING|"C:\zip"
[Actions\Action20]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""FLENAME"""
Params=FOLDER
[Actions\Action20\Params]
varname=STRING|"FLENAME"
[Actions\Action21]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""FILESIZE"""
Params=FOLDER
[Actions\Action21\Params]
varname=STRING|"FILESIZE"
[Actions\Action3]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|0
Name=STRING|"Show ""This task zips files located in a folder to thier own zip folder,"""
Params=FOLDER
[Actions\Action3\Params]
icon=STRING|"1"
msg0=STRING|"This task zips files located in a folder to thier own zip folder,"
msg1=STRING|"and includes a password."
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"
[Actions\Action4]
ActionID=STRING|"A_DIALOG_BROWSEFOLDERS"
Enabled=INTEGER|0
Name=STRING|"Browse for Folders"
Params=FOLDER
[Actions\Action4\Params]
caption=STRING|"Select Target Folder"
default=STRING|"None"
filter=STRING|"Text files|*.txt|All files|*.*|"
folder=STRING|"C:\binaries"
variable=STRING|"SELECTEDFOLDER"
[Actions\Action5]
ActionID=STRING|"A_DIALOG_BROWSEFOLDERS"
Enabled=INTEGER|-1
Name=STRING|"Browse for Folders"
Params=FOLDER
[Actions\Action5\Params]
caption=STRING|"Select Output Folder for Zip files"
default=STRING|"None"
filter=STRING|"Text files|*.txt|All files|*.*|"
folder=STRING|"C:\zip"
variable=STRING|"{ZIPFOLDER}"
[Actions\Action6]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 1000 ms"
Params=FOLDER
[Actions\Action6\Params]
delay=STRING|"10"
[Actions\Action7]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER
[Actions\Action7\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{SELECTEDFOLDER}"
value2=STRING|"None"
[Actions\Action8]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""[{Time}, {DayOfWeek}, {Date}]"""
Params=FOLDER
[Actions\Action8\Params]
icon=STRING|"1"
msg0=STRING|"[{Time}, {DayOfWeek}, {Date}]"
msg1=STRING|"No Folder is Selected"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"
[Actions\Action9]
ActionID=STRING|"A_FLOW_ELSE"
Enabled=INTEGER|-1
Name=STRING|"Else"
Zip file directory structure
I've modified your task, see below. Advice: use the {ExtractFileName()} variable to extract filename only.
For example: {ZIPFOLDER}\{ExtractFileName({filename})}.zip
For example: {ZIPFOLDER}\{ExtractFileName({filename})}.zip
Code: Select all
;**********************
;* RoboTask Task file *
;* Do not edit! *
;**********************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|1614811947
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task406"
Hide=INTEGER|0
ID=INTEGER|585389684
Name=STRING|"loop zip (single file per archive)"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|2
[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action14=FOLDER
Action15=FOLDER
Action16=FOLDER
Action17=FOLDER
Action18=FOLDER
Action19=FOLDER
Action2=FOLDER
Action20=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER
[Actions\Action1]
ActionID=STRING|"A_FOLDER_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create Folder (C:\binaries)"
Params=FOLDER
[Actions\Action1\Params]
newfolder=STRING|"C:\binaries"
[Actions\Action10]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set varible ""F_COUNT"" with value ""0"""
Params=FOLDER
[Actions\Action10\Params]
varname=STRING|"F_COUNT"
varvalue=STRING|"0"
[Actions\Action11]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER
[Actions\Action11\Params]
createmode=STRING|"1"
date1=STRING|"20040323"
date2=STRING|"20040323"
destvar=STRING|"FILENAME"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"{SELECTEDFOLDER}\*.*"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
savevar=STRING|"FILESIZE"
searchkind=STRING|"0"
subdirs=STRING|"0"
timesize=STRING|"0"
WithoutPath=STRING|"0"
[Actions\Action12]
ActionID=STRING|"A_VARIABLES_INCREMENT"
Enabled=INTEGER|-1
Name=STRING|"Increment variable ""F_Count"""
Params=FOLDER
[Actions\Action12\Params]
incement=STRING|"1"
vaiable=STRING|"F_Count"
[Actions\Action13]
ActionID=STRING|"A_ZIP_PACK"
Enabled=INTEGER|-1
Name=STRING|"Pack Files"
Params=FOLDER
[Actions\Action13\Params]
action=STRING|"0"
coment0=STRING|"{DateTime}, {DayOfWeek}"
coment1=STRING|"This zip-archive created by RoboTask (C) 2003 Neowise"
comentcount=STRING|"2"
compreslevel=STRING|"1"
destfile=STRING|"{ZIPFOLDER}\{ExtractFileName({filename})}.z ip"
dosformat=STRING|"0"
file0=STRING|"{filename}"
filecount=STRING|"1"
includesubfolders=STRING|"0"
incsysandhidden=STRING|"0"
junkdirnames=STRING|"1"
password=STRING|"2514524941259702596715215"
[Actions\Action14]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Actions\Action15]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action16]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 2500 ms"
Params=FOLDER
[Actions\Action16\Params]
delay=STRING|"25"
[Actions\Action17]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""F_COUNT"""
Params=FOLDER
[Actions\Action17\Params]
varname=STRING|"F_COUNT"
[Actions\Action18]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""TOTAL_SIZE"""
Params=FOLDER
[Actions\Action18\Params]
varname=STRING|"TOTAL_SIZE"
[Actions\Action19]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""FLENAME"""
Params=FOLDER
[Actions\Action19\Params]
varname=STRING|"FLENAME"
[Actions\Action2]
ActionID=STRING|"A_FOLDER_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create Folder (C:\zip)"
Params=FOLDER
[Actions\Action2\Params]
newfolder=STRING|"C:\zip"
[Actions\Action20]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""FILESIZE"""
Params=FOLDER
[Actions\Action20\Params]
varname=STRING|"FILESIZE"
[Actions\Action3]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|0
Name=STRING|"Show ""This task zips files located in a folder to thier own zip folder,"""
Params=FOLDER
[Actions\Action3\Params]
icon=STRING|"1"
msg0=STRING|"This task zips files located in a folder to thier own zip folder,"
msg1=STRING|"and includes a password."
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"
[Actions\Action4]
ActionID=STRING|"A_DIALOG_BROWSEFOLDERS"
Enabled=INTEGER|-1
Name=STRING|"Browse for Folders"
Params=FOLDER
[Actions\Action4\Params]
caption=STRING|"Select source Folder"
default=STRING|"None"
filter=STRING|"Text files|*.txt|All files|*.*|"
folder=STRING|"C:\binaries"
variable=STRING|"SELECTEDFOLDER"
[Actions\Action5]
ActionID=STRING|"A_DIALOG_BROWSEFOLDERS"
Enabled=INTEGER|-1
Name=STRING|"Browse for Folders"
Params=FOLDER
[Actions\Action5\Params]
caption=STRING|"Select Output Folder for Zip files"
default=STRING|"None"
filter=STRING|"Text files|*.txt|All files|*.*|"
folder=STRING|"C:\zip"
variable=STRING|"{ZIPFOLDER}"
[Actions\Action6]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 1000 ms"
Params=FOLDER
[Actions\Action6\Params]
delay=STRING|"10"
[Actions\Action7]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER
[Actions\Action7\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{SELECTEDFOLDER}"
value2=STRING|"None"
[Actions\Action8]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""[{Time}, {DayOfWeek}, {Date}]"""
Params=FOLDER
[Actions\Action8\Params]
icon=STRING|"1"
msg0=STRING|"[{Time}, {DayOfWeek}, {Date}]"
msg1=STRING|"No Folder is Selected"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"
[Actions\Action9]
ActionID=STRING|"A_FLOW_ELSE"
Enabled=INTEGER|-1
Name=STRING|"Else"
Zip file directory structure
thanks Oleg,
I am glad to contribute to this forum.
Thanks for the improvement too!
Jmail
I am glad to contribute to this forum.
Thanks for the improvement too!
Jmail