So i wrote a VBS script that searches a folder for titles with the word "The" at the beginning...
for example...
The Last Star Fighter
The Day the earth stood still
Gone with the wind
etc etc..
heres the code..
The Code should rename the titles as follows...
Last Star Fighter, The
Day the earth stood still, The
Gone with the wind
But when i run the VBS i get the following...
Last Star Fighter.mp4, The
Day the earth stood still.mp4, The
Gone with the wind
What am I doing Wrong please?
for example...
The Last Star Fighter
The Day the earth stood still
Gone with the wind
etc etc..
heres the code..
Code:
Const OverwriteExisting = True
Dim File, Folder, StrF, StrT
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
'/-> Set The Folder Path
Set Folder = Fso.GetFolder(Fso.GetParentFolderName(WScript.ScriptFullName))
'/-> Object For Collection
Set File = Folder.Files
For Each StrF In File
'/-> DDRM-filename1.doc Change This DDRM To Match What You Want To Filter
If InStr(StrF.Name,"The ") Then
StrT = Replace(StrF.Path, "The ", "") & ", The"
Fso.CopyFile(StrF.Path), (StrT),OverwriteExisting
Fso.DeleteFile(StrF.Path),True
End If
Next
The Code should rename the titles as follows...
Last Star Fighter, The
Day the earth stood still, The
Gone with the wind
But when i run the VBS i get the following...
Last Star Fighter.mp4, The
Day the earth stood still.mp4, The
Gone with the wind
What am I doing Wrong please?