Computing.Net > Forums > Programming > Removing special Characters in File names

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Removing special Characters in File names

Reply to Message Icon

Name: tab1962
Date: August 25, 2009 at 14:35:13 Pacific
OS: Windows XP
Product: Zoom 33.6k/14.4 v34 pnp win/dos
Subcategory: Batch
Tags: XP
Comment:

I attempting to remove any "," (commas) in the file names which I have thousands of files names that have this special character. Here is an example-
AK0031AA 1976-06-21 NEW CONSTRUCTION - CIVIL - EXCAVATION AND UTILITIES, EXCAVATION ELEVATIONS (C 3 1) 01806

Any ideas how I can do this on an entire directory C:\Scans that holds all these different files?

Thanks.

Tom

tom.baker@gsa.gov



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: August 25, 2009 at 17:11:02 Pacific
Reply:

Q&D VBScript:

Const folder = "." 'The full path of the folder with the files you want to change 
                   'ex: "c:\Documents And Settigns\you\yourstuff"
With CreateObject("Scripting.FileSystemObject")
  On Error Resume Next
  For Each file In .GetFolder(folder).Files
    file.Name = Replace(file.Name, ",", "")
  Next 'file
End With 'FSO


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Removing special Characters in File names

Removing Special Characters FOR Loop www.computing.net/answers/programming/removing-special-characters-for-loop/18895.html

count # of characters in file + EOF www.computing.net/answers/programming/count-of-characters-in-file-eof/4457.html

System date in file names www.computing.net/answers/programming/system-date-in-file-names/11350.html