The roots of education are bitter,
but the fruit is sweet.
-Aristotle
 
Home   News   Courses   Tips   Templates   Forums   Help   Order   Contact   Logon  
 
NEW: Excel Expert 11 - Learn XLOOKUP    dismiss
Tips & Tricks

New Tips Added Weekly!
Click here to get on our Mailing List

   
 
VBScript

Create Subfolders

How to create subfolders if they don't exist.

In this tip you will learn how to create subfolders if they don't exist.

	Sub subCreateFolders(strPath)
		If Right(strPath, 1) <> "\" Then
			strPath = strPath & "\"
		End If
		strNewFolder = ""
		Do Until strPath = strNewFolder
			strNewFolder = Left(strPath, InStr(Len(strNewFolder) + 1, strPath, "\"))
			If objFSO.FolderExists(strNewFolder) = False Then
				objFSO.CreateFolder(strNewFolder)
			End If
		Loop
	End Sub
	

You can now call this with a Folder path.

	Call subCreateFolders("D:\599CD\Downloads\vbs\")
	

And the folders will be created if they don't already exist.

 

Alex Hedley (Avatar) By: Alex Hedley


Click here to sign up for more FREE tips

 

You may want to read these articles from the 599CD News:

 

Learn
 
Accessindex
Excelindex
Wordindex
Windowsindex
PowerPointindex
Photoshopindex
Visual Basicindex
ASPindex
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
Lost Password
Free Upgrades
Insider Circle
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Articles
Search The Site
Waiting List
Production Schedule
Collapse Menus
Help
 
Live Chat
Customer Support
WalkThru Tutorials
Troubleshooting
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
MYOLP Memberships
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Gift CDs
Contact
 
Live Chat
General Info
Support Policy
Contact Form
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

YouTube Channel    LinkedIn

Blog RSS Feed