Copy Folder Structure

Discuss RoboTask here
Post Reply
csonon
Posts: 2
Joined: Mon May 04, 2020 2:51 pm

Copy Folder Structure

Post by csonon »

Hello -

I am trying to copy a folder structure that contains no data (used as a template for creating projects). I cannot find a way to do this and I want to avoid having to do a "Create Folder" for each instance as there are about 40 folders. I tried creating a ZIP package and using extract, I tried the Synchronize Folders feature with the Sync an Empty Folder option and Unidirectional and have not been able to get this to work. I am sure there has to be a more efficient way than "Create Folder" 40 times?
Oleg
Site Admin
Posts: 3004
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Copy Folder Structure

Post by Oleg »

You can use Synchronize Folders action.
Use a nonexistent file mask (for example: nofile.noext ) and turn ON the options:
  • Include subfolder
  • Sync an empty folders
Look at the small example below.
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.

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
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task171"
Hide=INTEGER|0
ID=INTEGER|434300207
LogOnAsUser=INTEGER|1
Name=STRING|"Synchronize Folders..."
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER

[Actions\Action1]
ActionID=STRING|"A_FOLDER_SYNCHRONIZE"
Enabled=INTEGER|-1
Name=STRING|"Synchronize Folders"
Params=FOLDER

[Actions\Action1\Params]
clearro=STRING|"0"
details=STRING|"0"
detailstovar=STRING|"0"
exact=STRING|"0"
foder1=STRING|"d:\temp"
foder2=STRING|"e:\test"
hidden=STRING|"0"
howsync=STRING|"1"
includeempty=STRING|"1"
includemask=STRING|"nofile.noext"
subdir=STRING|"1"
system=STRING|"0"
twosecprecision=STRING|"1"
This task creates the exact copy of folder structure without files
Oleg Yershov
csonon
Posts: 2
Joined: Mon May 04, 2020 2:51 pm

Re: Copy Folder Structure

Post by csonon »

Perfect! That worked. Thank you!
Post Reply