Create Folder (Data Management)
Summary
Creates a folder in the specified location.
Usage
-
The output folder name must be unique.
Syntax
CreateFolder_management (out_folder_path, out_name)
Parameter | Explanation | Data Type |
out_folder_path |
The disk location where the folder is created. | Folder |
out_name |
The folder to be created. | String |
Code Sample
CreateFolder Example (Python Window)
The following Python Window script demonstrates how to use the CreateFolder function in immediate mode.
import arcpy
from arcpy import env
arcpy.CreateFolder_management("C:/output", "folder1")
CreateFolder Example 2 (Stand-alone Python Script)
The following Python script demonstrates how to use the CreateFolder function in a stand-alone script.
# Name: CreateFolder_Example2.py
# Description: Create a folder
# Author: ESRI
# Import system modules
import arcpy
from arcpy import env
# Set workspace
env.workspace = "C:/data"
# Set local variables
out_folder_path = "C:/output"
out_name = "folder1"
# Execute CreateFolder
arcpy.CreateFolder_management(out_folder_path, out_name)
Environments
Related Topics
Licensing Information
ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013