Getting the EXACT same problem using DirScan(). Of course that might have something to do with the way I'm calling it since it's nearly identical to the previous... here is what my output looks like:
Code:
C:\Documents and Settings\cameron.wilson\Desktop\KiX\*.jpg
2
C:\Documents and Settings\cameron.wilson\Desktop\KiX\*.gif
2
C:\Documents and Settings\cameron.wilson\Desktop\KiX\Archive\*.mp3
2
C:\Documents and Settings\cameron.wilson\Desktop\KiX\Archive\*.avi
2
C:\Documents and Settings\cameron.wilson\Desktop\KiX\Archive\*.jpg
2
C:\Documents and Settings\cameron.wilson\Desktop\KiX\Archive\*.gif
2
Edit: Does the full name clear up the confusion Les? =P
Here is the code:
Code:
Break On
$ = SetOption("WrapAtEOL","On")
$dir = 'C:\Documents and Settings\cameron.wilson\Desktop'
$path = DirPlus($dir,"/ad /s")
$fileExt = ".mp3",
".avi",
".jpg",
".gif"
For Each $x in $path
For Each $y in $fileExt
$z = Dir($x+'\*'+$y)
? $x+'\*'+$y
If @Error <> 0
? @Error + ': ' + @SERROR
Endif
While $z <> "" and @ERROR = 0
? $z
Loop
Next
Next
sleep 20
I still get Dir() returning an error code of 2 and nothing in @SERROR and my output looks fine. Any other ideas? My end goal here is to feed the script a "root" directory. The script pulls all subdirs under it and checks each one for files with the extensions in the above array, it it finds those files, it will get a file size and write both those values to a report. I haven't gotten nearly as far as I want because of my scan problem.
Can anyone see a problem with the way I'm using Dir()? I pretty much just used the example out of the Kix2010.doc file for Dir() so I'm not sure where I'm getting the error. Any and all help is always appreciated.