How to determine if a directory exist within a certain path
Posted on 2006-07-13
I'm trying to create a program in VB6 that will look in a certain path and determine if a directory exist. The directory ends in .EMS, but the beginning characters of the directory name are randomly created. In other words, it could have any of the following names:
ABCXYZ.EMS, HKLMP.EMS, WXLPV.EMS, etc.
Even though they have a "." in the directory name, they are directories, not files. I want to locate the directory and copy a file into the directory. The program would looks something like this.
Look at file
If file ends in .EMS
copy \\server\share\file.ini to c:\MyFolder\<directory just found that ends in EMS>\
While there are still directories within folder c:\MyFolder or if EMS directory was found
I'm not sure if FSO would be the root to go? There will be only one directory within this folder that ends in EMS. I thought maybe I should look at the last 3 characters of each directory name and when I find one that ends in EMS, then copy my file into the directory.
My skills are very limited in VB so please help!