
Problems with "DIR" function
I am using the Dir function to know if a Directory exists or no. The
Directory is located in a server with Windows NT 3.51. The code is the
following:
strResult=Dir("P:\subdir1",vbDirectory)
and it works, I get strResult="SUBDIR1" and strResult="" if the directory
does not exist.
But now, I am asking for a directory in a server with Windows NT 4.0 and I
get the following results for
the folllowing intructions:
strResult=Dir("P:\subdir1",vbDirectory) ---------------->
strResult="????++Y" (More or less)
strResult=Dir("P:\subdir1\subdir2",vbDirectory) ---------------->
strResult=""
strResult=Dir("P:\subdir1\subdi2\subdir3",vbDirectory) ---------------->
strResult="SUBDIR3"
Watching the example of the help of VB, I see that the pathrouteis ended by
a Slash "\" and the funtion returns the first subdirectory inside the
Directory. I have two question:
- Is correct the use I am doing (without the ended slash)?
- If the answer to the previous question is Yes, why it does not work with
a server with Windows NT 4.0?
Thanks in advanced.