Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

"Create Folders" utility


  • Please log in to reply
3 replies to this topic
jballi
  • Members
  • 1029 posts
  • Last active:
  • Joined: 01 Oct 2005
I'm somewhat particular (read: anal) about file and folder management. I'm constantly taking stuff and moving into folders. So I've written a "Create Folders" utility using AHK to create empty folders that I use to manage my stuff. I use it all the time so I thought I would share it.

The program is bigger that I expected (I've over-documented as usual) so I've loaded it to AutoHotKey.net. You can download it (source code) from here: Create Folders.ahk

Here's a screenshot:
Posted Image


The program is not very useful unless the desired working directory is passed as a parameter to the program. For me, a Windows Explorer context menu that runs the program works the best. I created the following registry changes to install a "Create Folders" context menu item. Be sure to make the necessary changes to reflect your environment before running.
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\CreateFolders]
@="&Create Folders..."

[HKEY_CLASSES_ROOT\Directory\shell\CreateFolders\command]
@="\"C:\\Program Files\\AHK\\Create Folders\\Create Folders.exe\" \"%1\""

If you're not familiar with registry changes, simply store this code in a file with an extention of .reg and then double-click on the file to have Windows merge the changes into the registry. Don't forget to make the necessary changes to reflect your environment before running.

With the context menu item installed, simply right click on the desired folder in Windows Explorer, select the "Create Folders..." menu item you just installed, and you're on your way!

To uninstall the "Create Folders" context menu, simply remove the parent key from the registry:
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\shell\CreateFolders]

For the most part, the program should be self-explanitory but be sure to read the documentation in the source code to get the full load. I hope someone finds the program useful.

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
It's nice to see someone else making use of the Explorer context menu. ;)
"Anything worth doing is worth doing slowly." - Mae West
Posted Image

dreifach
  • Members
  • 1 posts
  • Last active: Jan 19 2008 02:53 PM
  • Joined: 19 Jan 2008
I've created a small script that does this very same thing, except mine is no where near as advanced!

I've been trying to get mine to do something that I can't figure out:

Create folders of a sequence in all subfolders of a target folder.

Example:
I wan to create the folder range 1-3 in all subfolders of a target folder. Target folder has 5 folder in it: A-C:

Target
  A
  B
  C

End result would be:

Target
  A
    1
    2
    3
  B
    1
    2
    3
  C
    1
    2
    3

This of course would scale up and involve subfolders embedded at least 5 deep.

Is there anyway you could incorporate this or point me in the right direction?[/code]

jballi
  • Members
  • 1029 posts
  • Last active:
  • Joined: 01 Oct 2005

I've created a small script that does this very same thing, except mine is no where near as advanced!

I've been trying to get mine to do something that I can't figure out:

Create folders of a sequence in all subfolders of a target folder.

Example:
I wan to create the folder range 1-3 in all subfolders of a target folder. Target folder has 5 folder in it: A-C:

[snip]

This of course would scale up and involve subfolders embedded at least 5 deep.

Is there anyway you could incorporate this or point me in the right direction?[/code]


There are many many ways to skin this cat. One possible solution:

ParentList=ABC
ChildList=123

loop parse,ParentList
    {
    Parent:=A_LoopField
    loop parse,ChildList
        FileCreateDir %Parent%\%A_LoopField%
    }
Note that only the lowest level child folder needs to be created. All parent folders will automatically be created if they don't already exist.

This is definitely an oversimplified solution to your problem but hopeful it will give an idea of what you need to do.