delete all but
delete all but
I know this is probably an easy thing but I can't seem to figure it out. I have a folder containing PDF's, txt files and other misc file types. I would like robotask to monitor that folder and delete all files that are created in it EXCEPT the PDF's. for the life of me I can't figure out how.
delete all but
See this small example. First we collect file names to delete (all files in c:\incoming folder except *.pdf). And, next, we delete files by the list.
;*******************************
;* RoboTask Task file
;* Do not edit in text editor!
;*******************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1947094105
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task538"
Hide=INTEGER|0
ID=INTEGER|1768068317
Name=STRING|"delete all files except *.PDF"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
[Actions]
Action1=FOLDER
Action2=FOLDER
[Actions\Action1]
ActionID=STRING|"A_FILE_SEARCH"
Enabled=INTEGER|-1
Name=STRING|"Create File List (c:\file_to_delete.txt)"
Params=FOLDER
[Actions\Action1\Params]
After=STRING|"0"
aftercount=STRING|"0"
AfterLine=STRING|"0"
Before=STRING|"0"
beforecount=STRING|"0"
BeforeLine=STRING|"0"
createmode=STRING|"1"
date1=STRING|"20071108"
date2=STRING|"20071108"
destfile=STRING|"c:\file_to_delete.txt"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
exclude=STRING|"*.pdf"
file0=STRING|"C:\incoming\*.*"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
searchkind=STRING|"0"
subdirs=STRING|"1"
WithoutPath=STRING|"0"
[Actions\Action2]
ActionID=STRING|"A_FILE_DELETE"
Enabled=INTEGER|-1
Name=STRING|"Delete File"
Params=FOLDER
[Actions\Action2\Params]
Count=STRING|"1"
deletedirs=STRING|"0"
file0=STRING|"{TextFile(c:\file_to_delete.txt)}"
subdir=STRING|"0"
ToRecycleBin=STRING|"1"
;*******************************
;* RoboTask Task file
;* Do not edit in text editor!
;*******************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1947094105
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task538"
Hide=INTEGER|0
ID=INTEGER|1768068317
Name=STRING|"delete all files except *.PDF"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
[Actions]
Action1=FOLDER
Action2=FOLDER
[Actions\Action1]
ActionID=STRING|"A_FILE_SEARCH"
Enabled=INTEGER|-1
Name=STRING|"Create File List (c:\file_to_delete.txt)"
Params=FOLDER
[Actions\Action1\Params]
After=STRING|"0"
aftercount=STRING|"0"
AfterLine=STRING|"0"
Before=STRING|"0"
beforecount=STRING|"0"
BeforeLine=STRING|"0"
createmode=STRING|"1"
date1=STRING|"20071108"
date2=STRING|"20071108"
destfile=STRING|"c:\file_to_delete.txt"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
exclude=STRING|"*.pdf"
file0=STRING|"C:\incoming\*.*"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
searchkind=STRING|"0"
subdirs=STRING|"1"
WithoutPath=STRING|"0"
[Actions\Action2]
ActionID=STRING|"A_FILE_DELETE"
Enabled=INTEGER|-1
Name=STRING|"Delete File"
Params=FOLDER
[Actions\Action2\Params]
Count=STRING|"1"
deletedirs=STRING|"0"
file0=STRING|"{TextFile(c:\file_to_delete.txt)}"
subdir=STRING|"0"
ToRecycleBin=STRING|"1"
Last edited by Oleg on Thu Nov 08, 2007 4:36 am, edited 1 time in total.