473,320 Members | 1,887 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,320 software developers and data experts.

Using VBA's Dir function this way: Dir Nul

MLH
Trying to understand what VBA is telling me when running
Dir c:\thisdir\thatsubdir\nul

I did the following in a command window:

C:\Docs\TitleWork>cd\

C:\>dir nul

Directory of \\.

File Not Found

C:\>

So, what exactly is DOS telling me here? I'm sure VBA is
taking the reply and interpreting it somehow. What is special
about nul (very different from null)? Try dir null in a command
window and you'll see.
Jun 27 '08 #1
2 2102
I think it may be checking to see if a directory exists

The "usual" way to check for the existence of a directory (no matter if it
has a dot in the name) is to check for the nul device inside it.

for example in a batch file
if exist any.dir\nul ECHO YES

"MLH" <CR**@NorthState.netwrote in message
news:84********************************@4ax.com...
Trying to understand what VBA is telling me when running
Dir c:\thisdir\thatsubdir\nul

I did the following in a command window:

C:\Docs\TitleWork>cd\

C:\>dir nul

Directory of \\.

File Not Found

C:\>

So, what exactly is DOS telling me here? I'm sure VBA is
taking the reply and interpreting it somehow. What is special
about nul (very different from null)? Try dir null in a command
window and you'll see.

Jun 27 '08 #2
MLH
Well that works for me.

Many thanks, Keith.
Jun 27 '08 #3

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

Similar topics

4
by: dixie | last post by:
I have a table called "tblParticipants" with a field called "ID", which must be indexed with No duplicates allowed. I am looking for a way of doing in vba a small if ..then ..else .. routine that...
11
by: Colleyville Alan | last post by:
I posted that I was having trouble with a SQL statement that was working in the SQL window, but not in VBA. I have since discovered that when I create the string in VBA it is over 1023 characters...
6
by: Clément Collin | last post by:
I working on a GIS project, with Access link which just need a little routine in VBA, but I haven't knowledges in VBA language. It's very simple, and it looks like that in a TPascal way : .......
14
by: Steve Jorgensen | last post by:
Recently, I tried and did a poor job explaining an idea I've had for handling a particular case of implementation inheritance that would be easy and obvious in a fully OOP language, but is not at...
9
by: Colin McGuire | last post by:
Hi, I have an report in Microsoft Access and it displays everything in the table. One column called "DECISION" in the table has either 1,2, or 3 in it. On my report it displays 1, 2, or 3. I want...
2
by: John Regan | last post by:
Hello All I am trying to find the owner of a file or folder on our network (Windows 2000 Server) using VB.Net and/or API. so I can search for Folders that don't follow our company's specified...
12
by: Joe | last post by:
Hello All: Do I have to use the LoadControl method of the Page to load a UserControl? I have a class which contains three methods (one public and two private). The class acts as a control...
2
by: billelev | last post by:
Hi there, Does anyone know how to store a constant in VBA that is set using a function or sub-routine? Here is the scenario. When I load up Access for the first time, I'd like to calculate...
7
by: ManningFan | last post by:
I've got a field in a table that keeps the name of functions I need to run. I do a DLookup on the table to retrieve the name of the function I need to run (based on whatever criteria). How...
1
by: JFKJr | last post by:
Hello everyone, the following Access VBA code opens an excel file and creates textboxes in a given range of cells dynamically. The code attaches "MouseUP" and "Exit" events to the textboxes (using...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.