May 10, 2005 #1 kerbaule IS-IT--Management Dec 29, 2003 24 FR Bonjour, I need to rename file with blank characters in file name This command need to be run in batch mode, so without any display on screen . Could someone give me a vbscript to do this ? many thanks E.kerbaul
Bonjour, I need to rename file with blank characters in file name This command need to be run in batch mode, so without any display on screen . Could someone give me a vbscript to do this ? many thanks E.kerbaul
May 10, 2005 #2 IvanhoBlanc Programmer Oct 22, 2002 3 BE ' Replaces all the blanks in the filename in a folder with "_" 'the folder where the files are stored Const Map = "C:\Scripts\SearchBlanks" Set ObjFileSystem = CreateObject("Scripting.FileSystemObject") Set Folder = ObjFileSystem.GetFolder(Map) Set Bestanden = Folder.Files For Each Bestand In Bestanden If InStr(Bestand.Name, " " ) > 0 Then Bestand.Name = Replace(Bestand.Name, " ", "_") End If Next Set Bestanden = Nothing Set Folder = Nothing Set ObjBestandSysteem = Nothing Upvote 0 Downvote
' Replaces all the blanks in the filename in a folder with "_" 'the folder where the files are stored Const Map = "C:\Scripts\SearchBlanks" Set ObjFileSystem = CreateObject("Scripting.FileSystemObject") Set Folder = ObjFileSystem.GetFolder(Map) Set Bestanden = Folder.Files For Each Bestand In Bestanden If InStr(Bestand.Name, " " ) > 0 Then Bestand.Name = Replace(Bestand.Name, " ", "_") End If Next Set Bestanden = Nothing Set Folder = Nothing Set ObjBestandSysteem = Nothing