Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > creating a dir


Reply
 
Thread Tools Display Modes
  #1  
Old 05-03-2003, 05:37 AM
Nell Nell is offline
Junior Contributor
 
Join Date: Feb 2002
Location: Whitley Bay, Tyne & Wear, England
Posts: 275
Default creating a dir


my code is supposed to create a dir if it dosent exist:

Code:
If Dir$(App.Path & "\Backup", vbNormal) = "" Then MkDir App.Path & "\Backup" End If

but i get an error on the second, any ideas?

cheers again.
__________________
cout << "Hello World!" << endl;
Reply With Quote
  #2  
Old 05-03-2003, 05:38 AM
Nell Nell is offline
Junior Contributor
 
Join Date: Feb 2002
Location: Whitley Bay, Tyne & Wear, England
Posts: 275
Default

its in the form load event incase that makes a difference?!
__________________
cout << "Hello World!" << endl;
Reply With Quote
  #3  
Old 05-03-2003, 05:39 AM
Squirm's Avatar
Squirm Squirm is offline
Political Coder

Retired Moderator
* Guru *
 
Join Date: Mar 2001
Location: London, England
Posts: 8,037
Default

The Dir$() function requires the path to have a trailing backslash:

Code:
If Dir$(App.Path & "\Backup\\", vbNormal) = "" Then MkDir App.Path & "\Backup" End If

Also, when running from the root directory, App.Path contains a trailing backslash, which you might want to check for.
__________________
Search the forums | Use [vb][/vb] tags | Still IRCing
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Reports Tryin General 1 04-06-2003 10:12 AM
Creating Forms w/Code blabore Interface and Graphics 7 02-25-2003 04:54 PM
Creating Microsoft Data Link file. Renidrag General 1 04-27-2002 02:22 PM
creating a DLL to hold string functions ChrisGreaves General 11 02-24-2002 11:26 AM
Problem creating exe file cunniman General 14 01-10-2002 01:30 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->