# Folderize Directory

**URL:** <https://resource.dopus.com/t/folderize-directory/56613>\
**Category:** Buttons/Scripts\
**Tags:** script, button, vbscript\
**Created:** [July 25, 2025, 3:46pm UTC](https://resource.dopus.com/t/folderize-directory/56613 "2025-07-25T15:46:14Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zion](https://resource.dopus.com/user_avatar/resource.dopus.com/zion/32/44060_2.png) [@Zion](https://resource.dopus.com/u/Zion)\
**Post date:** [July 25, 2025, 3:46pm UTC](https://resource.dopus.com/t/folderize-directory/56613/1 "2025-07-25T15:46:14Z")

</div>

1. This button creates folders for each file type in the current folder.
2. It then moves each file into it's corresponding folder.  
 ![image](https://resource.dopus.com/uploads/default/original/3X/b/f/bfd40493be2d8eab0a5c2d124f00fd5f194db4ad.jpeg)

[AutoBoxxed.dcf](https://resource.dopus.com/uploads/short-url/hxg2V05Xm7u9RNafhR2BPZOATjz.dcf) (2.3 KB)

---

<div class="post-metadata">

**Author:** ![abr](https://resource.dopus.com/user_avatar/resource.dopus.com/abr/32/62448_2.png) [@abr](https://resource.dopus.com/u/abr)\
**Post date:** [July 25, 2025, 5:00pm UTC](https://resource.dopus.com/t/folderize-directory/56613/2 "2025-07-25T17:00:43Z")

</div>

Interesting, but what's the idea behind it?

---

<div class="post-metadata">

**Author:** ![Zion](https://resource.dopus.com/user_avatar/resource.dopus.com/zion/32/44060_2.png) [@Zion](https://resource.dopus.com/u/Zion)\
**Post date:** [July 25, 2025, 5:16pm UTC](https://resource.dopus.com/t/folderize-directory/56613/3 "2025-07-25T17:16:51Z")

</div>

I use it to organize my downloads directory which gets out of hand all too often.

---

<div class="post-metadata">

**Author:** ![abr](https://resource.dopus.com/user_avatar/resource.dopus.com/abr/32/62448_2.png) [@abr](https://resource.dopus.com/u/abr)\
**Post date:** [July 25, 2025, 5:17pm UTC](https://resource.dopus.com/t/folderize-directory/56613/4 "2025-07-25T17:17:51Z")

</div>

So it's a sort of label. Thanks.

Not bad. I will try that now.

---

<div class="post-metadata">

**Author:** ![abr](https://resource.dopus.com/user_avatar/resource.dopus.com/abr/32/62448_2.png) [@abr](https://resource.dopus.com/u/abr)\
**Post date:** [July 25, 2025, 5:30pm UTC](https://resource.dopus.com/t/folderize-directory/56613/5 "2025-07-25T17:30:57Z")

</div>

Maybe you could modify the code that it autoboxes only the type of the selected item. For example **exe** only, when Shift-clicking the item. So both variations would work.

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [July 25, 2025, 5:33pm UTC](https://resource.dopus.com/t/folderize-directory/56613/6 "2025-07-25T17:33:03Z")

</div>

This error message will never be shown, because `WScript` is not available:

```plaintext
WScript.Echo "Error: Folder does not exist - " & folderPath
WScript.Quit 1

```

* * *

In Opus 13, this button will pretty much do the same:

```plaintext
Rename TO="prefix {{=UCase(ext)=}\*" IGNOREEXT

```

---

<div class="post-metadata">

**Author:** ![Zion](https://resource.dopus.com/user_avatar/resource.dopus.com/zion/32/44060_2.png) [@Zion](https://resource.dopus.com/u/Zion)\
**Post date:** [July 25, 2025, 10:30pm UTC](https://resource.dopus.com/t/folderize-directory/56613/7 "2025-07-25T22:30:13Z")

</div>

Certainly users can customize the script to suit _their_ workflow needs.

---

<div class="post-metadata">

**Author:** ![abr](https://resource.dopus.com/user_avatar/resource.dopus.com/abr/32/62448_2.png) [@abr](https://resource.dopus.com/u/abr)\
**Post date:** [July 25, 2025, 10:49pm UTC](https://resource.dopus.com/t/folderize-directory/56613/8 "2025-07-25T22:49:45Z")

</div>

Maybe some users, yes. It looks like Opus is getting more and more a tool for people who can code. That's a pity.

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [July 26, 2025, 5:51am UTC](https://resource.dopus.com/t/folderize-directory/56613/9 "2025-07-26T05:51:30Z")

</div>

> [@abr](#):
>
> that it autoboxes only the type of the selected item.

What does that mean? You want the prefix to be optional?

---

<div class="post-metadata">

**Author:** ![abr](https://resource.dopus.com/user_avatar/resource.dopus.com/abr/32/62448_2.png) [@abr](https://resource.dopus.com/u/abr)\
**Post date:** [July 26, 2025, 2:37pm UTC](https://resource.dopus.com/t/folderize-directory/56613/10 "2025-07-26T14:37:42Z")

</div>

I have a folder with all kinds of incoming stuff, images, text, executables, etc.  
What i mean is, it would be handy, if i could select an exe file, and the script would only autoboxx all files of that type, rather than having all the rest also autoboxxed. Maybe with Shift as a modifier key to restrict autoboxxing files only for selected extensions.

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [July 26, 2025, 2:52pm UTC](https://resource.dopus.com/t/folderize-directory/56613/11 "2025-07-26T14:52:51Z")

</div>

Something like this?

```plaintext
Rename FROM={sourcepath}*{file|ext} PATTERN=* TO="{file|ext2}\*"

```

---

<div class="post-metadata">

**Author:** ![abr](https://resource.dopus.com/user_avatar/resource.dopus.com/abr/32/62448_2.png) [@abr](https://resource.dopus.com/u/abr)\
**Post date:** [July 26, 2025, 3:05pm UTC](https://resource.dopus.com/t/folderize-directory/56613/12 "2025-07-26T15:05:37Z")

</div>

Yes, something like this. In the original script i like that there's that "autoboxx" name part, which looks a bit better than having a folder just nakedly named **exe**. Another quirk could be, if that script could recognize file type groups, so it would grab, for example, txt/rtf/doc in one go.

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [July 26, 2025, 3:23pm UTC](https://resource.dopus.com/t/folderize-directory/56613/13 "2025-07-26T15:23:40Z")

</div>

> [@abr](#):
>
> there's that "autoboxx" name part

```plaintext
Rename FROM={sourcepath}*{file|ext} PATTERN=* TO="Your prefix here {file|ext2}\*"

```

> [@abr](#):
>
> recognize file type groups

So you want to select _one_ .doc file, and the command moves _all_ files from that file type group into a folder named "Documents"? That would probably require a script, but since there are not so many file type groups, we could insert them directly, e.g.

```plaintext
Rename FROM={sourcepath}grp:Documents PATTERN=* TO="Whatever prefix - Documents\*"

```

---

<div class="post-metadata">

**Author:** ![abr](https://resource.dopus.com/user_avatar/resource.dopus.com/abr/32/62448_2.png) [@abr](https://resource.dopus.com/u/abr)\
**Post date:** [July 26, 2025, 3:27pm UTC](https://resource.dopus.com/t/folderize-directory/56613/14 "2025-07-26T15:27:08Z")

</div>

Well, that's only an idea, as how to extend that script idea. I'm already happy with the simple version, and we also have grouping already, which only requires a few simple steps to achieve some similar results.

---

<div class="post-metadata">

**Author:** ![jinsight](https://resource.dopus.com/user_avatar/resource.dopus.com/jinsight/32/43666_2.png) [@jinsight](https://resource.dopus.com/u/jinsight)\
**Post date:** [July 27, 2025, 6:25pm UTC](https://resource.dopus.com/t/folderize-directory/56613/15 "2025-07-27T18:25:11Z")

</div>

Here is a front end to @lxp's suggested code:

```auto
//https://resource.dopus.com/t/folderize-directory/56613/5

@filesonly

//I listed my top eight file type groups containing a single extension
//Modify the list to your most common file type groups that contain a single extension
@Set Grp {dlgstringS|Create a New Folder of Files of a Selected File Type Group\n\nPlease enter the file type group: pdf, txt, wpd, html, 7z, png, mp3, doc.}

Rename FROM={sourcepath}grp:{$Grp} PATTERN=* TO="Folder of ''{$Grp}'' file type group files\*"
Go REFRESH=expanded,source,state,filterclear

```

You will need to create single extension file groups and list them above.

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [July 27, 2025, 7:08pm UTC](https://resource.dopus.com/t/folderize-directory/56613/16 "2025-07-27T19:08:22Z")

</div>

> [@abr](#):
>
> It looks like Opus is getting more and more a tool for people who can code. That's a pity.

I might be wrong but, is it not more that your needs are becoming more esoteric, because your basics are already taken care of? So the things you haven't already set up are the things that are (often) on the more complicated end.

The more unique the thing you want to do or streamline, the more likely it is to not be provided by default, and require some button editing, or regular expressions, or even a little jscript code. But I don't think anyone _has_ to do those things to use Opus, and I'd be surprised if anyone thinks Opus has gotten harder to use over the long time you or anyone else has been been using it.

People here will often spend hours helping with those things when it's needed, too.

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [July 27, 2025, 8:10pm UTC](https://resource.dopus.com/t/folderize-directory/56613/17 "2025-07-27T20:10:10Z")

</div>

> [@abr](#):
>
> It looks like Opus is getting more and more a tool for people who can code.

No, that's an optical illusion. It may look like this because your willingness to follow advice is declining. In reality, Opus' upgrades make it easier to use and reduce the need for coding.

> [@abr](#):
>
> That's a pity.

Someone trying to blame the SatNav for taking the wrong turn?

---

<div class="post-metadata">

**Author:** ![Zion](https://resource.dopus.com/user_avatar/resource.dopus.com/zion/32/44060_2.png) [@Zion](https://resource.dopus.com/u/Zion)\
**Post date:** [August 4, 2025, 4:51pm UTC](https://resource.dopus.com/t/folderize-directory/56613/18 "2025-08-04T16:51:11Z")

</div>

Super Slick one liner! LXP

Rename TO="prefix {{=UCase(ext)=}\*" IGNOREEXT
