473,796 Members | 2,560 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating a directory

Hi
I can use "Application.Cu rrentProject.Pa th & "\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 2270
* mi*********@gma il.com:
Hi
I can use "Application.Cu rrentProject.Pa th & "\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_Queri es"
Set fs = CreateObject("S cripting.FileSy stemObject")
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*********@gma il.com wrote:
Hi
I can use "Application.Cu rrentProject.Pa th & "\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*********@gma il.com wrote:
Hi
I can use "Application.Cu rrentProject.Pa th & "\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*********@gma il.com wrote:
Hi
I can use "Application.Cu rrentProject.Pa th & "\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
7211
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 created if they don't already exist, and if the drive happens to be one a folder cannot be created on (ie a cdrom drive) it would just be skipped without the code generating any errors. your help on this would be most appreciated. jenny
0
1761
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 when trying to configure the application root for this Web. Web projects may not operate correctly without an application root. The returned error was: Active Directory Services cannot find the web server. A possible cause for this is an...
3
2015
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 virtual directory on my pc the directory does not exist. If i create the folder from explorer then select hide/show files within vs.net I see the directory I just created. When I include that directory in my project by right clicking and selecting...
8
3998
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 ID=MyID
1
4631
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 System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.Directory.InternalCreateDirectory(String fullPath, String path) at System.IO.Directory.CreateDirectory(String path)
1
3030
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 everyone, I am having a problem with creating directories using the
9
1661
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 I get the following stack trace: System.IO.DirectoryNotFoundException: Could not find a part of the path "D:\". at System.IO.__Error.WinIOError
5
3506
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 case. One handle remains open. Debugging shows that it's actually the IIS cache and not ASP.NET that owns this handle. During IIS shutdown, the handle is closed with the following stack trace: ChildEBP RetAddr 0006fbe4 5a403e05...
15
2837
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. Everything is the default settings I believe. IIS is running under Local System. In IIS the DefaultAppPool is running under Network Service. Annonymous access uses the account IUSR_JASMINE (machine name is Jasmine).
6
1782
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 change applies to is deleted and recreated. All the children for that directory are also re created (as the parent directory then has a different name). the problem i have is that *sometimes* the files or directories don't get created. It either...
0
9684
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9530
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10182
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10017
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7552
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6793
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.