473,382 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Creating a directory

Hi
I can use "Application.CurrentProject.Path & "\Template" to check that
a directory exists on a users hard drive. What i am having trouble
finding is the code to add a directory to the users C:/ drive if it
doesn't exist.

Any help would be appreciated.

Jun 18 '06 #1
5 2253
* mi*********@gmail.com:
Hi
I can use "Application.CurrentProject.Path & "\Template" to check that
a directory exists on a users hard drive. What i am having trouble
finding is the code to add a directory to the users C:/ drive if it
doesn't exist.

Any help would be appreciated.


This works from me:

Dim GSQ_dir As String
Dim fs
On Error GoTo SaveFailed
GSQ_dir = CurrentProject.Path & "\GSQ_Queries"
Set fs = CreateObject("Scripting.FileSystemObject")
If Not fs.folderexists(GSQ_dir) Then
fs.createfolder (GSQ_dir)
End If

Hope it helps.

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
Jun 18 '06 #2
Randy

It's exactly what I'm looking for. Thanks for your help, it's
appreciated.

Mick

Jun 18 '06 #3
mi*********@gmail.com wrote:
Hi
I can use "Application.CurrentProject.Path & "\Template" to check that
a directory exists on a users hard drive. What i am having trouble
finding is the code to add a directory to the users C:/ drive if it
doesn't exist.

Any help would be appreciated.


Access/VBA has the built in MkDir command for creating directories.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jun 18 '06 #4
rkc
mi*********@gmail.com wrote:
Hi
I can use "Application.CurrentProject.Path & "\Template" to check that
a directory exists on a users hard drive. What i am having trouble
finding is the code to add a directory to the users C:/ drive if it
doesn't exist.

Any help would be appreciated.


Call MkDir (folder)
Jun 18 '06 #5
Thanks rkc

rkc wrote:
mi*********@gmail.com wrote:
Hi
I can use "Application.CurrentProject.Path & "\Template" to check that
a directory exists on a users hard drive. What i am having trouble
finding is the code to add a directory to the users C:/ drive if it
doesn't exist.

Any help would be appreciated.


Call MkDir (folder)


Jun 18 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: jenny | last post by:
Hi, I am trying to find a VB way that would create a folder on all existing drives - the folder name would be the same on each drive. ie c:\backup, d:\backup, etc. But the folders would only be...
0
by: Robert | last post by:
I get these errors when creating a asp .net web application project in VS 2003 on a remote web server: "Microsoft Development Environment The Web was created successfully, but an error occurred...
3
by: dave | last post by:
I am using vs.net 2003 on windows xp. After clicking on a project within my solution and selecting create new folder vs.net responds back with , the "directory already exists". If i look at the...
8
by: mcmg | last post by:
Hi, I have an asp app that works fine on a windows xp machine but does not work on a windows 2000 server. I have the following code in my global.asa: <OBJECT RUNAT=Server SCOPE=SESSION...
1
by: Arvind P Rangan | last post by:
Hi, I have tried creating folders through ASP.Net with Directory.Create(path) But it gives me error mscorlib Access to the path "C:\WINNT\system32" is denied. at...
1
by: Senthil | last post by:
Con is the file name for a reserved device name(i think it is for console). So you cannot create a file with name 'con'. choose some other name senthil >-----Original Message----- >Hi...
9
by: Sheldon Cohen | last post by:
Hello, I am using c# and running a site that is on a shared host. The code in question is supposed to create a new directory that is coming out of a text box. It works fine on my computer, but...
5
by: Sam777 | last post by:
I was under the impression that creating the app_offline.htm file at the root of the webapp would cause all handles to be closed so that the app could be removed. Unfortunately, this isn't the...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
6
by: Charlie Bear | last post by:
i'm really stuck with this one can anyone help! i have a website that uses c#. it creates a series of directories and files from an xml source. when the xml changes, the directory that the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.