HOW TO

Create a directory using the System.Execute() instruction

Last Published: April 25, 2020

Summary

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

Procedure



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

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

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

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


Note:
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

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic