question

christian.n avatar image
1 Like"
christian.n asked Ben Wilson commented

Can I use FlexScript to create a windows folder?

Hey all.

I am looking for a way to create a windows folder with FlexScript.

This would come in handy when using exporttable() to export various tables after a run. I would like to create a folder in modeldir(), named "Scenario X" where X is a global variable.

Any help would be appreciated.

Thanks. Christian

FlexSim 17.0.2
create folder
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Cameron Pluim avatar image
6 Likes"
Cameron Pluim answered Braydn T commented

You can use this application command:

string foldername = concat(modeldir(), "MyNewFolder");
applicationcommand("createdirectory", foldername);
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

christian.n avatar image christian.n commented ·

Thanks a lot guys. Just what I needed.

0 Likes 0 ·
Mischa Spelt avatar image
3 Likes"
Mischa Spelt answered jing.c commented

You can "abuse" the runprogram() command for this:

runprogram( concat("cmd.exe /e mkdir \"", modeldir(), "Scenario X", "\"") );

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.