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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating directories using VB6

Status
Not open for further replies.

VBAguy22

IS-IT--Management
Joined
Aug 5, 2003
Messages
180
Location
CA
Hello all,
How can I create a directory using VB6? Say, I want to create C:\BlahThanks
 
Hi,

insert a reference to "Microsoft Scripting Library" and use this code:

with new FileSystemObject
.CreateFolder folderName
end with

nicsin
 
Oh well, I guess mmilan's solution is much simpler... :-)
 
Or, if you're not M*A*D, mkdir "C:\blah"...

mmilan (lol)

Ps. It's worth reading about the File Scripting object - and nicsin is right to mention it. I just don't think you need it for the task you mention...

 
Quite right mmilan. I just crossposted with you...

All the best,
nicsin
 
Aye - didn't see your second post nicsin - sorry...

 
ok thanks guys, how would u check if C:\blah\ already exists?
 
use the fso object again

fso.folderexists("C:\blah\") returns boolean result

BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top