I hope someone will post here an answer based on InitializationCells
because I wasn't able to make them work for me.
This is quick walkaround:
DynamicModule[{},
Framed["dir created"]
, Initialization :> (
CreateDirectory[FileNameJoin[{"C:", "Users", "Kuba", "Desktop", "dir1"}]];
CreateDirectory[FileNameJoin[{"C:", "Users", "Kuba", "Desktop", "dir2"}]];
)
]
Evaluate this code (Probably You will have to change "Kuba" in path :)). Save it in trusted directory. Create task via Windows Task Scheduler to open this file.
Works for me.
Big disadvantage is that You have to evaluate code with all procedures.
Quick solution Put conditional construct in Initialization
of this DynamicModule
. It can check if there is directory called "ENABLED" in it's directory. There will not be such during first evaluation. Create manually directory "ENABLED" after saving main notebook.
Run
will always enable you to fill in the gaps. $\endgroup$