"BrianB" wrote:
[Quoted Text] > I have a file name that gets a unique name each day. Example: > "4SLKOutgoing000869.240507". I need to read in the filename, extract the 6 > digits before the ".". This example would be "000869". I'm using VBScript > and am going to it run using WSH. The file is the only one in the folder, so > I don't need to dig through a lot of file names. >
theFolder = "C:\test\"
set fso = CreateObject _ ("Scripting.FileSystemObject") set folder = fso.GetFolder (theFolder)
for each file in folder.Files WScript.Echo Right _ (fso.GetBaseName (file.Path), 6) next -- urkec
|