• Welcome to Valhalla Legends Archive.
 

Dir() Function

Started by Lobo, November 06, 2003, 09:40 PM

Previous topic - Next topic

Lobo

Im useing the directory function to find files with a certain extension. Here's the code im useing so far.


Dim SFindFile as string
SFindFile = Dir(App.Path & "\*.ini")
lstprofile.Additem SFindFile


Now I only get 1 file added to the listbox, but I have more then 1 in the directory. I tryed looping it but I don't think I did the loop right, maybe you can point out something that will help me. If not thanks for looking at it.
Look it's a signature.

iago

http://visualbasicforum.com/showthread.php?t=99464&highlight=fso%2A

QuoteHello,
I have a folder that has *.tif and *.txt files in it...
I want to point to the folder and read the file names. If the file names match my criteria i want to copy them to another folder.
I know how to point to a file within a folder using the commondialog. and read *.txt files but I dont know how to read in the files in a folder. How do I just read the file names in a folder so I can move the ones I that match the criteria?
Can anyone point me to a web page that might help?
Thanks.


The question is answered there.  I hope that helps! :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Spht

After defining file mask you want to use with Dir, you can then use Dir with no parameters to continuously get the next matching file. After Dir returns nothing, then you've reached the end of the matching files.

Lobo

Thanks Spht, and iago. Also sorry if I toke up any of your time with this question.
Look it's a signature.

iago

Nope, I just did a quick google search for "visual basic dir" (without the quotes)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*