12-09-2025 03:29 AM
Hi all,
I use VBS scripts to modify channel names in DAT files. This works great as long as all DAT files are in the same folder. Now I was asked to to something similar, but this time, the DAT files are in different subfolders (or sub-sub-subfolders). Only one dat file per subfolder.
How can I modify my script to make it look for all DAT files in all subfolders?
here is my code:
12-15-2025 01:07 PM
Hi RodegroO,
You can use DirListGet() with one of the recursive options to return a list of files with certain name string matching, from inside all the sub-folders of a starting directory.
StartFolder = "D:\Analysis Servers\"
FoundFiles = DirListGet(StartFolder, "*_2025*.bakas", "filename", "FullFilenamesRecursive")
LogFileWrite String(110, "=")
LogFileWrite Join(FoundFiles, vbCRLF)
LogFileWrite String(110, "=")
Brad Turpin
Principal Technical Support Engineer
NI / Emerson