Skip to content

Instantly share code, notes, and snippets.

@rossarioking
Created October 7, 2019 16:37
Show Gist options
  • Save rossarioking/cf8e7b98cd4dbdf48211283c4a9bff4c to your computer and use it in GitHub Desktop.
Save rossarioking/cf8e7b98cd4dbdf48211283c4a9bff4c to your computer and use it in GitHub Desktop.
Creating Basic Folders and Files with VBScript #VBScript
Option Explicit
Dim objFileSystemObject, objParentFolder, objChildFolder, objFile
'Create an instance of the file System Object
Set objFileSystemObject = CreateObject("Scripting.FileSystemObject")
'Create Monthly report folder (Parent Folder)
Set objParentFolder = objFileSystemObject.CreateFolder("C:\Monthly Reports")
'Create child folder
Set objChildFolder = objFileSystemObject.CreateFolder("C:\Monthly Reports\January\")
'Create Report text File
Set objFile = objFileSystemObject.CreateTextFile("C:\Monthly Reports\January\JanuaryReport.txt")
WScript.Quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment