I have developed a routine which prepares a directory listing for a specific
folder and save this information into a text file. This text file would be
used to send the required files via SFTP to a unix server.
My problem is that the case of the file name changes to lower case. For
example, the file name would appear in the folder as OPICS_Greeks.txt but
would appears as opics_greeks.txt in the text file. How can I retain the
original file name structure in the text file?
Below is the snippet:-
Set objTextFile = objFSO.OpenTextFile _
(StrFileName, ForAppending, True)
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='" & strLocalFolder & "'} Where " _
& "ResultClass = CIM_DataFile")
For Each objFile In colFileList
' Define Short Name
StrFile = Len (objfile.Name)
StrDiff = (StrFile - strStart) + 1
ShortName = MID(objfile.name, strStart, StrDiff)
'Write Files to be transmitted to Text file
objTextFile.WriteLine ShortName
Next
'Close Transmit Text File
objTextFile.close