Connecting Tech Pros Worldwide Help | Site Map

Recursive folder searching

Investigator's Avatar
Newbie
 
Join Date: Oct 2009
Posts: 2
#1: Oct 11 '09
HI.... Another newbe to the site.... looking for a little help.

I have a DB for the purpose of Invetsigations, each time that a new case is opened the process generate two new folders (1.Photos and 2.Doc's) these are contained on the server in K:\Enforcement\Investigated_Cases\ENF xxxx (xxx=the new job number)

My team download photos taht are taken and are supposed to save them into the respective Photo folder.... unfortunately, sometimes they don't.

I need to create a module to search the complete Investigated_Cases folder in each ENFxxx folder and check if there are any .jpg present, if so i then need to move any jpg's to the respective Photo Folder.

Hope this makes sense.... Is anyone able to help me.... please
smartchap's Avatar
Familiar Sight
 
Join Date: Dec 2007
Location: Lucknow, India
Posts: 194
#2: Oct 11 '09

re: Recursive folder searching


First of all where is your team loading .jpg files, in K:\Enforcement\Investigated_Cases\ENF xxxx folder or somewhere else. And I think each ENF xxxx folder has two folders named Photos and Docs. How the number xxxx is created? Is it a serial number, i.e. 1, 2, 3 and so on or something else? If it is a serial number with same increment then put the search code in a For...Next loop and search each K:\Enforcement\Investigated_Cases\ENF xxxx folder and put the .jpg file found there to correcponding K:\Enforcement\Investigated_Cases\ENF xxxx\Photos folder.
Investigator's Avatar
Newbie
 
Join Date: Oct 2009
Posts: 2
#3: Oct 11 '09

re: Recursive folder searching


Hi Smartchap
Thanks for the reply.....
The Photo & Doc's folders are generated automatically when you create the next investigation referred to as [CustomerID], theses are now created sequentially. However the earlier jobs did not create Photo & Doc folders when a new file was opened, they simply created the ENF xxxx folder
Hope this all makes sense….

See the extracted text below from the complete section

str1 = "K:\Enforcement\Investigated_Cases\ENF " & [CustomerID]:
pho1 = "\Photos": doc1 = "\Doc's"

' ***** Create New Photo & Document Folder For New Case *****
str2 = str1 + pho1: str3 = str1 + doc1
MkDir str1: MkDir str2: MkDir str3
str1 = "": str2 = "": str3 = ""
Reply


Similar Visual Basic 4 / 5 / 6 bytes