Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i create a new folder

Status
Not open for further replies.

Gti

Programmer
Jul 23, 2001
99
PT
I
How can i create a new folder?
tkx
 
Add a reference to 'Microsoft Scripting Runtime' and:

Dim fsoFileSystem As FileSystemObject
Dim fsoFolder As Folder
Set fsoFileSystem = New FileSystemObject

Set fsoFolder = fsoFileSystem.CreateFolder("C:\Madlarry")



You might want to read up on the FileSystemObject in MSDN.

Madlarry
 
Sorry Madlarry, but i don't undestood very well that thing of FSO... Can you give all the code that a i need! I tried to read info on MSDN but i dind't understand very well!
VB gives me an error on the first line, why?
 
Have you added a reference to the Microsoft Scripting Runtime library?? Go to the Project menu and choose References to view the references.

Madlarry
 
Try this

Dim fsoFileSystem
Dim fsoFolder
Set fsoFileSystem = CreateObject("Scripting.FileSystemObject")
Set fsoFolder = fsoFileSystem.CreateFolder("C:\Madlarry")

Hope it's helps

________

George
 
Tkx a lot to both... Shaddow version was very useful!
;o)
 
Or you can just use the VB command of MkDir:

MkDir "C:\niv3k"

kinda easier. You also have ChDir, CurDir, and RmDir to Change directory, get current directory, or remove directory.

Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top