Move folder and files to folder in same folder

Discuss RoboTask here
Post Reply
rice1973
Posts: 86
Joined: Mon Jan 04, 2010 2:38 am
Location: Netherlands
Contact:

Move folder and files to folder in same folder

Post by rice1973 »

Hi Oleg,

I cannot get it fixed to build a move task.

Folderstructure is like below;

I want to move the folders orbitvu and orbitvu12_basic and the file 18765-266.10.300.html into the folder 18765-266.10.300

The name of the folder 18765-266.10.300 is variable and also the name of the 18765-266.10.300.html file.

The name of the parent folder is 3dmap.

I
Attachments
folder.jpg
folder.jpg (54.57 KiB) Viewed 22796 times
Robotask rules! :)
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Move folder and files to folder in same folder

Post by Oleg »

See my example:

Code: Select all

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1416408852
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task117"
Hide=INTEGER|0
ID=INTEGER|620029868
LogOnAsUser=INTEGER|1
Name=STRING|"Rename Files and folders"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""FOLDER"" with value ""18765-266.10.300"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"FOLDER"
varvalue=STRING|"18765-266.10.300"

[Actions\Action2]
ActionID=STRING|"A_FOLDER_CHANGE"
Enabled=INTEGER|-1
Name=STRING|"Change Folder (C:\Temp\test)"
Params=FOLDER

[Actions\Action2\Params]
folder=STRING|"C:\Temp\test"

[Actions\Action3]
ActionID=STRING|"A_FILE_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy/Move File"
Params=FOLDER

[Actions\Action3\Params]
destdir=STRING|"{folder}"
f_count=STRING|"3"
file0=STRING|"{folder}.html"
file1=STRING|"orbitvu"
file2=STRING|"orbitvu12_basic"
hidden=STRING|"1"
ifexists=STRING|"0"
move=STRING|"1"
subdir=STRING|"0"
system=STRING|"1"

Oleg Yershov
rice1973
Posts: 86
Joined: Mon Jan 04, 2010 2:38 am
Location: Netherlands
Contact:

Re: Move folder and files to folder in same folder

Post by rice1973 »

Hi,

The foldername 18765-266.10.300 also has to be variable.
So the task must "read" it from the foldername.

Now you set is as a "solid" valeu.
Robotask rules! :)
rice1973
Posts: 86
Joined: Mon Jan 04, 2010 2:38 am
Location: Netherlands
Contact:

Re: Move folder and files to folder in same folder

Post by rice1973 »

Hi Oleg,

I modified the task, still does not work. Can you look?

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|1981091247
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task117"
Hide=INTEGER|0
ID=INTEGER|620029868
LogOnAsUser=INTEGER|1
Name=STRING|"Rename Files and folders (imported)"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""FOLDER"" with value """""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"FOLDER"

[Actions\Action2]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER

[Actions\Action2\Params]
createmode=STRING|"1"
date1=STRING|"20130118"
date2=STRING|"20130118"
destvar=STRING|"FOLDER"
DuringDays=STRING|"1"
DuringHours=STRING|"1"
DuringMinutes=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"C:\3dmap\360\?????-???.??.???"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderHours=STRING|"1"
OlderMinutes=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
searchkind=STRING|"1"
sort=STRING|"0"
sortby=STRING|"0"
sortorder=STRING|"0"
subdirs=STRING|"0"
timesize=STRING|"0"
WithoutPath=STRING|"0"

[Actions\Action3]
ActionID=STRING|"A_FOLDER_CHANGE"
Enabled=INTEGER|-1
Name=STRING|"Change Folder (C:\3dmap)"
Params=FOLDER

[Actions\Action3\Params]
folder=STRING|"C:\3dmap"

[Actions\Action4]
ActionID=STRING|"A_FILE_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy/Move File"
Params=FOLDER

[Actions\Action4\Params]
destdir=STRING|"{folder}"
f_count=STRING|"3"
file0=STRING|"{folder}.html"
file1=STRING|"orbitvu12"
file2=STRING|"orbitvu12_basic"
hidden=STRING|"1"
ifexists=STRING|"0"
move=STRING|"1"
subdir=STRING|"0"
system=STRING|"1"

[Actions\Action5]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
Robotask rules! :)
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Move folder and files to folder in same folder

Post by Oleg »

I think that you should to move step#3 (change folder) out of the loop.
It seem this example can help you:

Code: Select all

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|933306365
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task505"
Hide=INTEGER|0
ID=INTEGER|620029868
LogOnAsUser=INTEGER|1
Name=STRING|"Rename Files and folders"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""FOLDER"" with value """""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"FOLDER"

[Actions\Action2]
ActionID=STRING|"A_FOLDER_CHANGE"
Enabled=INTEGER|-1
Name=STRING|"Change Folder (C:\3dmap\360\)"
Params=FOLDER

[Actions\Action2\Params]
folder=STRING|"C:\3dmap\360\"

[Actions\Action3]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER

[Actions\Action3\Params]
createmode=STRING|"1"
date1=STRING|"20130118"
date2=STRING|"20130118"
destvar=STRING|"FOLDER"
DuringDays=STRING|"1"
DuringHours=STRING|"1"
DuringMinutes=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"?????-???.??.???"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderHours=STRING|"1"
OlderMinutes=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
searchkind=STRING|"1"
sort=STRING|"0"
sortby=STRING|"0"
sortorder=STRING|"0"
subdirs=STRING|"0"
timesize=STRING|"0"
WithoutPath=STRING|"0"

[Actions\Action4]
ActionID=STRING|"A_FILE_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy/Move File"
Params=FOLDER

[Actions\Action4\Params]
destdir=STRING|"{folder}"
f_count=STRING|"3"
file0=STRING|"{folder}.html"
file1=STRING|"orbitvu12"
file2=STRING|"orbitvu12_basic"
hidden=STRING|"1"
ifexists=STRING|"0"
move=STRING|"1"
subdir=STRING|"0"
system=STRING|"1"

[Actions\Action5]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
Oleg Yershov
rice1973
Posts: 86
Joined: Mon Jan 04, 2010 2:38 am
Location: Netherlands
Contact:

Re: Move folder and files to folder in same folder

Post by rice1973 »

Solved!
Robotask rules! :)
Post Reply