I'm using the following VBS script to delete the first n number for line from a file:
strInputFile = "*Filename.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Const intForReading = 1
Set objInputFile = objFSO.OpenTextFile(strInputFile, intForReading, False)
If Not objInputFile.AtEndOfStream Then
objInputFile.SkipLine
Else
WScript.Quit
End If
strContents = ""
While Not objInputFile.AtEndOfStream
If strContents = "" Then
strContents = objInputFile.ReadLine
Else
strContents = strContents & VbCrLf & objInputFile.ReadLine
End If
Wend
objInputFile.Close
Set objInputFile = Nothing
Set objOutputFile = objFSO.CreateTextFile(strInputFile, True)
objOutputFile.Write strContents
objOutputFile.Close
Set objOutputFile = Nothing
Set objFSO = Nothing
How do I change the code so that instead of a constant input file it will be an argument when I start the program via CMD?