Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Replace Spaces in File and Folder Names with Underscores

 
Logged in as: Guest
arrSession:exec spGetSession 2,16,48607
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> Replace Spaces in File and Folder Names with Underscores
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Replace Spaces in File and Folder Names with Underscores - 6/21/2007 12:57:29 PM   
  prodonjs

 

Posts: 3
Score: 0
Joined: 6/19/2007
Status: offline
I found this script to be necessary when I started dual booting between Linux and Windows. I got into the bad habit of using spaces often in my filenames and that's a big no-no if you're working from the console in Linux. It really makes things complicated. This should be pretty thorough and self-explanatory from my documentation.


      

EDIT(EBGREEN): Code tags are your friend.

< Message edited by ebgreen -- 6/22/2007 1:54:06 AM >
 
 
Revisions: 1 | Post #: 1
 
 RE: Replace Spaces in File and Folder Names with Unders... - 6/22/2007 8:44:53 AM   
  Fredledingue


Posts: 337
Score: 0
Joined: 5/9/2005
From:
Status: offline
The main line on this script is Replace(file.name ,"  ","_")
Beside that everything is personal options but it's an interresting one.

If you want you can to check one similar script of mine: Go here
http://www.geocities.com/fredledingo/vbscripts.htm
and scroll down to FixFileName 7.0

Actualy it replaces dots by undrscores. Especialy useful to have regular, dos-looking names in your Favorite folder.
It can be easily changed to replace white space by _. 

You may be interrested by the set of safeguards for the system folders.

I noticed that you work with extentions without using the
objFSO.GetExtensionName(file) method ...



_____________________________

Fred

(in reply to prodonjs)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> Replace Spaces in File and Folder Names with Underscores Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts