Javascript CreateFolder method of FileSystemObject (FSO) provides the functionality to create a folder of specified name at the specified location of the client’s PC. You can create a new folder in the file system of client’s computer if he has set the security of web browser that allows your web page to interact with his PC. If the security of web browser of client’s PC is in favor with your Javascript FSO and automation server permissions then you can create a new folder using CreateFodler method very easily. 

Syntax for Javascript FSO CreateFolder Method

fso.createFolder( Path ); 

As shown in the above syntax createFolder method accepts 1 parameter as Path for the new folder, where it is to be created. Also remember that the path for a new folder must contain folder name at the end of the path that is to be created.

Example for Javascript FSO CreateFolder Method

<script type="text/javascript">
    // initialize ActiveXObject and create an object of Scripting.FileSystemObject.
    var fso = new ActiveXObject("Scripting.FileSystemObject");

    // creates a folder with specified name at the specified location
    fso.CreateFolder("C:\\Temp\\myFolder");

    fso = null;
</script>

Continue to next tutorial: Javascript FSO CreateTextFile Method to learn how to create a text file on client’s PC.

Recent JavaScript Tutorials

Javascript FSO ShortPath property

Javascript FileSystemObject (FSO) provides a ShortPath property that can be accessed using the folder object or file object returned by the GetFolder or GetFile method.

Javascript FSO Path Property

Javascript FileSystemObject (FSO) provides the Path property that can be accessed through the file object or folder object returned by the GetFile or GelFolder method

Javascript FSO Type property

Javascript FileSystemObject (FSO) provides a Type property that can be accessed through file object or folder object returned by the GetFile or GetFolder method

Javascript FSO ShortName property

Javascript FileSystemObject (FSO) provides a ShortName property that can be accessed using the folder object or file object returned by the GetFolder or GetFile method.

Javascript FSO Name Property

Javascript FileSystemObject (FSO) provides a Name property that can be accessed using file object or folder object.