The script below works fine. It searches a specified location for .exe files and outputs a file which contains the location of the files.
All of that works great. Except I'd like the output file lines to all be enclosed in " ", how to do this?
Option Explicit 'force all variables to be declared
On Error Resume Next
Const ForWriting = 2
Dim objFSO
Set objFSO = CreateObject(Scripting.FileSystemObject)
Dim objTS 'Text Stream Object
Set objTS = objFSO.OpenTextFile("output_path", ForWriting, True)
Recurse objFSO.GetFolder("location_of_files")
objTS.Close()
Sub Recurse(objFolder)
Dim objFile, objSubFolder
For Each objFile In objFolder.Files
If LCase(objFSO.GetExtensionName(objFile.Name)) = "exe" Then
objTS.WriteLine(objfile.Path)
End If
Next
For Each objSubFolder In objFolder.SubFolders
Recurse objSubFolder
Next
End Sub