Create multiple subfolders with ascending numbers

It is possible to create script for button (or maybe just command line) to create multiple subfolders in some folder with same names and following ascending numbers? For example, I need to create multiple subfolders, like _001 , _002 , _003 , ... , _020. Couple days after, I need to create another subfolders in same folder with "running counter' - _021 , _022, ... , Name>_035, and in future, I'll need to create more subfolders with numbers raising. Directory Opus so powerfull, there should be way to simplify this process, I hope.

Sorry, typo, rising, not raising

Here you go, I made a button to do this:

[Create Multiple Numbered Folders)

Thank you, leo! This works perfectly! However, I noticed, in case some previously created numbered folders has been deleted, this script recreate them again and count. Sometimes, it could be useable, sometimes not. If you'll have time, could you modify this script? I think input dialog like ,, will be more useable for me and someone else. And... could you recommend good source, website or book, to learn basic of scripting?

Thank you

Hi leo,
Although the properties of the hyperlink indicate it's target is Create_Multiple_Folders.dcf,
when I click it it opens as Create_Multiple_Folders.xml.
I used a context menu "save target as" to rename it back to Create_Multiple_Folders.dcf .

Worse yet, I can't get your button to work yet.
I get a UAC prompt and then failure.

No matter, that really is only minor background info to the end of my post tonight.
pav56 wrote:

I presume that means that if one or more of the numbered folders has been deleted,
that a subsequent press of the button replaces these missing numbers before creating new numbers > the previous highest numbered folder.
Is that correct ?
I hope so, as I think that is how this should logically work.

I also think there could be a separate button to rename any numbered folder to a different number.
If the new number already exists, other numbers >= that number are adjusted by +1.

I also think that a there could be a separate button to then eliminate number gaps in the sequence.


To Zippo
First, I used "save target as" and rename file extension after too.
Second, buttons works without any problem for me.
It works this way: I created 10 folders with this button, numbered from 001 to 010. After that, I deleted first nine, keep folder with number 010. I used button to create 10 folders again, and it creates folders 001 - 009 and folder 011.

Button for eliminate number gaps in the sequence is a excellent idea. About button to rename numbered folder to a different number - for me this can be easy done with rename dialog - just to check box sequential numbering, choose number what you need - that's all, it could be done in one click for any number or files or folders. Actually, at this time I work this way. I burn lot of data backups disks, so I create lot of folders named "Backup" with sequential numbers and fill it with data, trying to keep total size close by disk recording capacity. I use name of folder as a disk label too. So, after those disks has been burned and checked for errors, I don't need those folders anymore. Button, created by leo is works very good for me, but I need to make another steps - I create needed numbers of folders in some another folder, rename them in numbers, which I need now, and finally move them to my working folder. That's why I asked for modification of script.

That's easy to do. I've posted a reply to the button's thread with an alternative button that takes a range:

[Create Multiple Numbered Folders)

There are quite a few Learn VBScript / VBScript tutorial websites but I don't know which ones are the best.

If you want to learn scripting in general, not just for doing simple stuff in Opus, then you might also want to look into JavaScript, Python, Ruby or Perl. I use VBScript because people can run buttons that use it without having to install anything but you might prefer one or the other languages or find it has better tutorials and is easier to learn. Different people like different languages. (Personally, I dislike most scripting languages, but they're useful for little things like this.)

You can hook many of the scripting languages up with Opus. (See here.)

I think you can already do that using the Add a Unique Number while renaming rename preset. Set the old name to * and the new name to FolderName_[NUM] (literally) and it will do the rest.

I've zipped up the file now to avoid that problem. Seems like IE7 renames the file but Firefox3 does not, FWIW.

You must be running it in a folder that needs UAC elevation to create folders in it. The button won't work in that situation. (Looks like it tries to do something quite odd, too. Not sure what's going on there.)

Found it. I was giving the RECURSE argument to the Rename command. It was left over from a previous button that I made and wasn't meant to be there in this button.

I've uploaded new versions of both buttons which fix that. They still won't work in folders requiring UAC elevation but they won't do anything wrong in that situation either.

Thank you so much, leo! Directory Opus is excellent, you are excellent too! :slight_smile: