Paths -- Creating File Path with several levels -- VBScript 
Author Message
 Paths -- Creating File Path with several levels -- VBScript

I am a beginner at using VBScript.  I hope someone can point me in the right
direction.  My problem is this:
I am trying to produce an input box that will allow the user to specify
where (s)he wants a database to be placed.  My code includes:

    If Not oFileSys.FolderExists(PathName) Then
        oFileSys.CreateFolder(PathName)      ' ***
    End If

This works fine if the user wants a folder below the root directory, like
C:\Cats, but when they want to go a bit further and specify C:\Cats\Dogs the
script gives an error message: "Path not found" and cites the beginning of
the line I have marked with asterisks.

Leonard



Fri, 06 Aug 2004 19:13:28 GMT  
 Paths -- Creating File Path with several levels -- VBScript

Quote:

> This works fine if the user wants a folder below the root directory, like
> C:\Cats, but when they want to go a bit further and specify C:\Cats\Dogs the
> script gives an error message: "Path not found" and cites the beginning of
> the line I have marked with asterisks.

You will need a recursive function to do this. Take a look at this thread for a
function that does this:


Subject: Create a folder
Newsgroups: microsoft.public.scripting.vbscript
Date: 2002-02-15 02:37:52 PST

You can use http://groups.google.com/advanced_group_search to fetch it :-)

--
torgeir



Fri, 06 Aug 2004 20:08:22 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Creating relative directory path given fully-qualified path

2. Dir Path Or File Path

3. Converting logical paths to UNC paths

4. Long Path Names give Runtime error 76 - Path not found

5. Converting logical paths to UNC paths

6. Adding path to Path entry

7. Long Path Names give Runtime error 76 - Path not found

8. Adding path to Path entry

9. Converting local path to UNC path?

10. PS level one and clipping paths

11. Extending the Initial Clipping Path in Level I PS

12. VBScript for file path?

 

 
Powered by phpBB® Forum Software