AutoHotkey Community

It is currently May 25th, 2012, 10:43 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: "Create Folders" utility
PostPosted: December 16th, 2005, 7:01 am 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 774
Location: Texas, USA
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:
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.
Code:
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:
Code:
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 16th, 2005, 5:58 pm 
Offline

Joined: November 8th, 2004, 12:46 am
Posts: 1271
It's nice to see someone else making use of the Explorer context menu. ;)

_________________
"Anything worth doing is worth doing slowly." - Mae West
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 19th, 2008, 4:02 pm 
Offline

Joined: January 19th, 2008, 3:53 pm
Posts: 1
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:

Code:
Target
  A
  B
  C


End result would be:

Code:
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]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2008, 5:26 am 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 774
Location: Texas, USA
dreifach wrote:
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:

Code:
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: ELengefeld and 10 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group