I have an ASP script that can do this. It should be easily modifiable to
VBScript.
Have a look on http://www.sourcecodecorner.com in the articles section.
Dave.
~~
All I ask is a chance to prove that money can't make me happy.
Tips, tricks and articles for programmers of all languages on
http://www.sourcecodecorner.com
Advertise your car for free on http://www.drivingseat.com
Quote:
> I am trying to list all the files in a specified directory.
> Dir function does work...
> Does anybody know why?
> In the following code, the first call to Dir returns empty string rather
> than first file name;
> strFile = Dir(strDir) ' Retrieve the first entry.
> Do While strFile <> "" ' Start the loop.
> ' Ignore the current directory and the encompassing directory.
> If strFile <> "." And strFile <> ".." Then
> strPath = strDir + strFile
> If (GetAttr(strPath) And vbDirectory) = vbDirectory Then
> Debug.Print "Directory:" + strPath
> 'GetFiles (strPath)
> Else
> Debug.Print strPath
> End If
> End If
> strFile = Dir() ' Get next entry.
> Loop