I have a script that I'm trying to use to delete files off a server. I have a .txt file with the location of the files needing deleting. How do I get the VB script to look line for line through the txt file and delete the files listed there?
Here's the VB stuff I have so far:
'Created by Larry Plowman
On Error Resume Next
Dim strFiles
Dim objFileListing
Dim strDeleteFile
Dim objFSO
Const ForReading = 1
set objFSO = CreateObject("Scripting.FileSystemObject")
strDeleteFile = InputBox("Enter path to text document with files to be deleted:")
Set objFileListing = objFSO.OpenTextfile(strDeleteFile,ForReading)
Do Until objFileListing.AtEndOfStream
strFiles = objFileListing.ReadLine
Del ("strFiles")
Loop
objDeleteFile.Close
WScript.Echo "File Deletion Complete."
and here's what the txt file lines will look like:
\\laj-dm-01\c$\LAJ-RDR1\laj-rdr1\MSG\SVS\SVM\SVM\my voting assistance brief.ppt
Only about 3,000 lines worth of stuff like that. Thus the necessity for a script. :)