Skip to content

Instantly share code, notes, and snippets.

@gavD
gavD / RecursivelyStripSpacesFromFilesnames.vbs
Created August 15, 2012 09:37
VBScript to recursively remove spaces from filenames in a directory
Dim fso : Set fso = WScript.CreateObject("Scripting.FileSystemObject")
sub fixFolder(path)
Dim fol : Set fol = fso.GetFolder(path)
For Each fil In fol.Files
If InStr(1, fil.Name, ".bxl") <> 0 Then
If InStr(1, fil.Name, " ") <> 0 Then
dim newName : newName = Replace(fil.Name, " ", "")
fil.Name = newName