06/12/27 00:07:16 3S+qRJIr0
Dim outputFile
Set outputFile = fso.OpenTextFile(fso.GetParentFolderName(list) & "\rename.bat", 2, True)
If Err.Number <> 0 Then
WScript.Echo Err.Description
Set fso = Nothing
Set inputFile = Nothing
Set outputFile = Nothing
WScript.Quit
End If
Dim regIn
Set regIn = New RegExp
regIn.Pattern = "^.*\.mkv"
Do While inputFile.AtEndOfStream <> True
Dim matches
Set matches = regIn.Execute(inputFile.ReadLine)
If matches.Count > 0 Then
Dim orgName
Dim newName
orgName = matches(0)
newName = inputFile.ReadLine
outputFile.WriteLine("if exist """ & orgName & """ ren """ & orgName & """ """ & newName & ".mkv""")
End If
Loop
inputFile.Close
outputFile.Close