xcaliber13
Technical User
I need a little help with this vbs script. The script works great but I want to be able to open any file that is in the folder without having to give the exact name of the file.
Here is the script:
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\temp\test.txt", ForReading)
strText = objFil.ReadAll
objFile.Close
strNewText = Replace(strText, "CH00", "")
Set objFil = objFSO.OpenTextFile("C:\temp\test.txt", ForWriting)
objFile.WriteLine strNewText
objFile.Close
I cannot figure out how to get this script to open any (*.txt) file in the C:\temp folder
Any help would be Great
Here is the script:
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\temp\test.txt", ForReading)
strText = objFil.ReadAll
objFile.Close
strNewText = Replace(strText, "CH00", "")
Set objFil = objFSO.OpenTextFile("C:\temp\test.txt", ForWriting)
objFile.WriteLine strNewText
objFile.Close
I cannot figure out how to get this script to open any (*.txt) file in the C:\temp folder
Any help would be Great