Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
CREATE A SUB DIRECTORY ON THE FLOPPY DISK USING FS...
Author:
Louis Delongchamp
E-mail:
Click to e-mail author
Website:
http://www.cyberbeach.net/~loudelon
Submitted:
8/31/2001
Version:
VB6
Compatibility:
VB6
Category:
File Manipulation
Views:
8980
CREATE A SUB DIRECTORY ON THE FLOPPY DISK USING FSO.
Declarations:
Start a new VB6 project and place this code in the form. There MUST be a floppy disk in the A: drive. Make SURE the directory 'MyDirectory' does not already exist.
Code:
Private Sub Form_Load() SubDirectories End End Sub Private Sub SubDirectories() Dim fsO As Object Dim oDirectory As Object Dim oFolders As Object Dim oSubDir As Object ' Check if the directory already exists If Dir$("A:\MyDirectory", vbDirectory) <> "" Then MsgBox ("The directory 'MyDirectory' exists already; delete it or change disks!") Else Set fsO = CreateObject("Scripting.filesystemObject") ' Create the directory Set oDirectory = fsO.CreateFolder("A:\MyDirectory") ' Establish it as a container of folder objects Set oFolders = oDirectory.SubFolders ' Add a sub directory to MyDirectory without mentionning it's location! Set oSubDir = oFolders.Add("SubDirectory") End If Set fsO = Nothing Set oDirectory = Nothing Set oFolders = Nothing Set oSubDir = Nothing End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2023 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement