Question : Custom indexing on sub folders

I have a set of documents that two different groups need to use. Our customer service people use Part Number when dealing with the customer and our shop workers use Die Number when producing parts. I'd like a program that will build a custom index based on the die numbers so that a user clicking on the die number will open the subfolder. I have attached the proposed folder structure. There will be multiple customer names and multiple part numbers inside each customer name. There could even be multiple die numbers inside each part number.

Is this possible? I'd like to avoid having the shop workers use windows search every time they need to load a program. Thanks.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
Customer Files
  >  Customer Name
    >  Part Number
      >  PO
      >  Prints
      >  Die Number
        >  Programs
      >  Other Documents

Answer : Custom indexing on sub folders

Paste the script below into a text file with a .vbs extension.  Customize the value of the strRoot variable on line 4 with the location of the Customer Files folder.  Be sure to use the same drive letter or UNC path which users will access the files by.  Customize the value of the strOutput variable on line 5 with the location of the index file to create.

This VBScript does not require installing any additional software.  Running it will scan the folder structure and create an HTML file with links to each die number's folder.  It could be set up to run periodically with a scheduled task to refresh the index if the folders change.

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
Const adVarChar = 200
Const MaxCharacters = 255
 
strRoot = "C:\Customer Files"
strOutput = "C:\Index.htm"
strPattern = ".*\\([A-Z]\d{6,6})$"
 
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objOutput = objFSO.CreateTextFile(strOutput, True)
 
Set DataList = CreateObject("ADOR.Recordset")
DataList.Fields.Append "DieNumber", adVarChar, MaxCharacters
DataList.Fields.Append "Path", adVarChar, MaxCharacters
DataList.Open
 
strCommand = "cmd /c @echo off & dir " & _
    Chr(34) & strRoot & Chr(34) & " /a:d /b /s"
 
Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec(strCommand)
Set objStdOut = objWshScriptExec.StdOut
strList = objWshScriptExec.StdOut.ReadAll
 
Set objRegExp = New RegExp
objRegExp.Pattern = strPattern
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.MultiLine = True
 
Set objMatches = objRegExp.Execute(strList)
 
For Each objMatch in objMatches
    DataList.AddNew
    DataList("DieNumber") = objMatch.SubMatches(0)
    DataList("Path") = objMatch.Value
    DataList.Update
Next
 
DataList.Sort = "DieNumber"
DataList.MoveFirst
 
Do Until DataList.EOF
    objOutput.WriteLine "" & _
        DataList.Fields.Item("DieNumber") & "
" DataList.MoveNext Loop objOutput.Close
Random Solutions  
 
programming4us programming4us