Using VBA"s Dir function this way: Dir Nul

Using VBA"s Dir function this way: Dir Nul

am 15.04.2008 16:18:52 von 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.

Re: Using VBA"s Dir function this way: Dir Nul

am 15.04.2008 20:33:52 von Cagey

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" wrote in message
news:84e904tg5sailrs8g4tvpvuaa1lnujn87g@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.

Re: Using VBA"s Dir function this way: Dir Nul

am 16.04.2008 00:26:09 von MLH

Well that works for me.

Many thanks, Keith.