cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
ENTHU
Level IV

How to check if a folder exists and create if not?

 
2 REPLIES 2
MichelleG
Level III

Re: How to check if a folder exists and create if not?

You are looking for the functions Directory Exists("path") and Create Directory("path"). Something like:

 

path = "C:\foo\bar";
If(!Directory Exists(path),
     Create Directory(path),
     Print(path||" already exists.")
);
txnelson
Super User

Re: How to check if a folder exists and create if not?

Look at function

     Is Directory()

to check to see if a directory exists, and

     Create Directory()

to create a directory

Names Default To Here( 1 );
If( Is Directory( "C:\zippy" ) == 0,
	rc = Create Directory( "CL\zippy" )
);

Examples and definition of these functions are found in

     Help==>Scripting Index

Jim