Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a folder with 1,236 folders within it. The folders are named XXXXXXXXXXXXX, where X are multiple different numbers (ex. 4210014516510, 1730015624386, etc.) Is there a way I can batch format these folders to retain their numbers, but add dashes? XXXX-XX-XXX-XXXX Example: 4210014516510 becomes 4210-01-451-6510, and 1730015624386 becomes 1730-01-562-4386
Thanks

http://www.joejoesoft.com/cms/showp...
Rename Master will do that. Does files and folders, check the Configuration panel out before you start and look for the Folder Only option.
Practice on a few unimportant folders beforehand to gain confidence before you execute the task.

No need to download anything. Use vbscript (assuming all subfolders are named by numbers)
Set objFS = CreateObject("Scripting.FileSystemObject")
strFolder = "c:\test"
Set objFolder = objFS.GetFolder(strFolder)
For Each Folder In objFolder.SubFolders
strFolderName = Folder.Name
strFirstPortion = Mid(strFolderName,1,4)
strSecondPortion = Mid(strFolderName,5,2)
strThirdPortion = Mid(strFolderName,7,3)
strFourthPortion = Mid(strFolderName,10,4)
strNewName = strFirstPortion&"-"&strSecondPortion&"-"&strThirdPortion&"-"&strFourthPortion
Folder.Name=strNewName
Nextsave the above as script.vbs and on command line
c:\test> cscript /nologo script.vbs

But you expect someone who's asking how to do this to a) blindly trust you with a vbs script b) know what you are on about in the first place c) know how to do it without instruction, like putting the code in notepad.
Rename Master is well established, requires no installation, is 740kB, is infinitely more versatile.

why not?
1) The code is viewable. OP can look up the meaning if unsure. Better than using software whose code is not viewable?
2) I am not here to spoonfeed anyone. So i am not obliged to give more instructions than i already have. also, running vbscript is so straightforward, anyone can do it. If not, look it up!
3) Its true that you can use other software besides those provided natively to perform the task, but you should also know that not all environments allows third party installation/tools..
4) If OP wants, he can use the software, my post is just another suggestion. Its not up to you to decide.

why not?
Where did I say don't.
1) The code is viewable. OP can look up the meaning if unsure. Better than using software whose code is not viewable?
Email him for the source if it's not in there (it used to be) or read the thread provided, or post a query on the thread provided.
2) I am not here to spoonfeed anyone. So i am not obliged to give more instructions than i already have. also, running vbscript is so straightforward, anyone can do it. If not, look it up!
Cool, your prerogative of course just don't expect people to understand exactly what you are on about, that's all.
3) Its true that you can use other software besides those provided natively to perform the task, but you should also know that not all environments allows third party installation/tools..
And running a foreign vbs script from code someone "got off the internet" would be permissible in that environment. (I'm not querying the code btw).
4) If OP wants, he can use the software, my post is just another suggestion. Its not up to you to decide.
I didn't say it was up to me to decide anything at all. I wanted to point out what I pointed out. You answered - cool. lol.

Where did I say don't.
First paragraph.Email him for the source if it's not in there (it used to be) or read the thread provided, or post a query on the thread provided.
I totally don't understand what you are saying. My first point is in reply to this:
a) blindly trust you with a vbs script in which i say, OP can view my code, and decide whether he wants to run it. If unsure, he can look up what its doing. As you can see, my code is pretty straight forward anyone can understand.Cool, your prerogative of course just don't expect people to understand exactly what you are on about, that's all.
Are you saying that i have not commented enough? Or are you saying that people are generally lazy and doesn't know how to do research and self study?And running a foreign vbs script from code someone "got off the internet" would be permissible in that environment. (I'm not querying the code btw).
What i am saying is, the scripting engine WSH is installed by default when the M$ OS is installed. By writing a script from scratch, there's no need to download any stuffs if environment doesn't allow. Of course, some environment may be even stringent that WSH is disabled but that's another story.

I'm sorry to have a caused an issue, but I wanted to thank you both for your quick and great suggestions.

First paragraph.
I didn't say don't, I just gave reasons that would be valid from a novice's point of view.
I totally don't understand what you are saying. My first point is in reply to this:
a) blindly trust you with a vbs script in which i say, OP can view my code, and decide whether he wants to run it. If unsure, he can look up what its doing. As you can see, my code is pretty straight forward anyone can understand.I said if someone doesn't trust the origin or integrity of Rename Master they have more than one avenue to verify it's origin / integrity. On face value, if they don't know vbs it's hard for them to verify your script as good or bad. A UI gets round that for most people, which is why most people still use programs with a UI as opposed to command line.
Are you saying that i have not commented enough?
Pretty much, yeh. But I understand and respect where you are coming from.
Or are you saying that people are generally lazy and doesn't know how to do research and self study?
People can be generally lazy and a novice can often arrive at the wrong answer(s) left to there own devices, computing.net forums are littered with testament to that. ...and here is where we will disagree, I suspect. I would have thought the onus was on you to be more specific (yes, an element of spoon-feeding, if you like) seeing as though you are offering an alternative and you don't know the skill level of the OP.
But that's my opinion based on what it looks like reading the answer from a novice's perspective.
What i am saying is, the scripting engine WSH is installed by default when the M$ OS is installed. By writing a script from scratch, there's no need to download any stuffs if environment doesn't allow. Of course, some environment may be even stringent that WSH is disabled but that's another story.
Yep, and I accept all that and I don't disagree with what you say. Apart from the points I raised before. I wasn't saying you were wrong to point an alternative out - it's no big deal in the grand scheme of things. lol.

![]() |
![]() |
![]() |

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