Create a directory using the System.Execute() instruction

Last Published: April 25, 2020


The System.Execute() command allows system level calls. On the DOS platform,
system calls are a part of the Command.Com


Paste the following single line into a new or existing script.

System.Execute("c:\ /c mkdir c:\temp")

The following code prompts you to enter the new directory into a dialog box.

newDir=MsgBox.Input("Type in new directory","Create Directory", "")
System.Execute("c:\ /c mkdir" ++ newDir)

Make sure the whole path already exists for the last subdirectory before you create the new directory. For example, if you type in "C:\mydata\maps\parcels", then the directory "C:\mydata\maps" must already exist. All other operating system directory naming rules are still apply.

Article ID:000002470

  • Legacy Products

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options