Solved

Change the folder names to the right format

Posted on 2007-11-21
4
182 Views
Last Modified: 2010-03-05
Hi,

Change all the folders name to the right format.
Each word should start with a Caps.
Change any type of folder names to clear format.
SHARATH to be changed as Sharath
SHarath to be change to Sharath
Sharath reddy to be changed to Sharath Reddy

Any way of doing this for a folder and all sub folders within it.
Can a script or a tool do this
Regards
Sharath
0
Comment
Question by:bsharath
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
Basheerpt earned 500 total points
ID: 20332834
0
 
LVL 11

Author Comment

by:bsharath
ID: 20332950
Thanks for the links but this software was hanging and had problems with it...I found this..
"Ftweak-Case.exe" Which works great....
0
 
LVL 25

Expert Comment

by:imitchie
ID: 20332975
be very careful.. some folders are special. you don't want to rename "Documents and Settings" to "Documents And Settings" for example.
BE VERY CAREFUL - create a temp folder and some subfolders to test.

change the last line to where you want to start
ShowSubfolders FSO.GetFolder("C:\temp\mytestfolder")

' modified from asp101.com
Function PCase(strInput)
	Dim iPosition
	Dim iSpace
	Dim strOutput
	iPosition = 1
	Do While InStr(iPosition, strInput, " ", 1) <> 0
		iSpace = InStr(iPosition, strInput, " ", 1)
		strOutput = strOutput & UCase(Mid(strInput, iPosition, 1))
		strOutput = strOutput & LCase(Mid(strInput, iPosition + 1, iSpace - iPosition))
		iPosition = iSpace + 1
	Loop
	strOutput = strOutput & UCase(Mid(strInput, iPosition, 1))
	strOutput = strOutput & LCase(Mid(strInput, iPosition + 1))
	PCase = strOutput
End Function
 
Set FSO = CreateObject("Scripting.FileSystemObject")
 
Sub ShowSubFolders(Folder)
    For Each Subfolder in Folder.SubFolders
        FSO.MoveFolder Subfolder.Path , PCase(Subfolder.Path)
        ShowSubFolders Subfolder
    Next
End Sub
 
ShowSubfolders FSO.GetFolder("C:\temp\mytestfolder")

Open in new window

0
 
LVL 11

Author Comment

by:bsharath
ID: 20332982
Thanks i am just changing folders that ae created by me...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question