DonationCoder.com Forum

DonationCoder.com Software => Coding Snacks => Finished Programs => Topic started by: GoodGuy98 on July 15, 2010, 02:12 PM

Title: DONE: Right-Click Menu Create Folder with Enhancements
Post by: GoodGuy98 on July 15, 2010, 02:12 PM
Right-Click Menu Create Folder with Enhancements

I would like to have a new Windows Explorer right-click menu item that does the following:

Ask for the new folder name
Create that new folder under the current folder
Change to the newly created subfolder
Create an empty text file named Url.txt
Open the newly created empty text file with Notepad or the associated app for .txt files.

I copy and paste a website url into the empty text file and save it.

When I find new software I like, I save the file(s) as well as the url where I found it for
later reference.

This is a before and after folder-file listing to show what I mean.

Before:

C:\Top Folder\
  C:\Top Folder\Subfolder One\
    C:\Top Folder\Subfolder One\Url.txt

After:

C:\Top Folder\
  C:\Top Folder\Subfolder One\
    C:\Top Folder\Subfolder One\Url.txt
  C:\Top Folder\Subfolder Two\
    C:\Top Folder\Subfolder Two\Url.txt

I would right-click while in Top Folder and create the new Subfolder Two
with an empty Url.txt file opened in Notepad etc.

Currently I use a MS-DOS batch file within my Sendto folder to accomplish
this task, but it has a few drawbacks which the new software would cure.
This is my Batch file in case that will help.

C:\Documents and Settings\Userid\SendTo contains a shortcut to a batch file.

NewFold.bat

@echo off

:: The parameter %1 contains the path from the SendTo command
:: The For command extracts the Drive Letter (C:) from the path

Set Var=%1%
For %%i in ("%Var%") Do Set dl=%%~di

%dl%
cd %1

echo.
:folder
set folder=
set /P folder=Enter New Folder Name: %=%
if "%folder%"=="" goto folder

if not exist "%folder%" md "%folder%"

cd "%folder%"

start /max %SystemRoot%\explorer.exe /e,%Var%\%folder%

if not exist Url.txt copy nul Url.txt >nul
start /max notepad.exe Url.txt

Exit

My system is running Windows XP SP3.
Title: Re: IDEA: Right-Click Menu Create Folder with Enhancements
Post by: skwire on July 15, 2010, 02:43 PM
Currently I use a MS-DOS batch file within my Sendto folder to accomplish
this task, but it has a few drawbacks which the new software would cure.
This is my Batch file in case that will help.

What are the drawbacks you hope to solve?
Title: Re: IDEA: Right-Click Menu Create Folder with Enhancements
Post by: GoodGuy98 on July 15, 2010, 03:05 PM
The current method leaves the original folder open, so I have to manually close it. The new folder isn't always located next to the original one because
other ones are open, so you have to be careful while closing it.

It also fails occasionally by not creating the subfolder in the selected top level folder. I didn't research it at the time, but I am guessing it
had something to do with path lengths or spaces in the folder structures. It works for the most part, but looks too DOS like. It's not a
big deal though.

Thank you for the reply.
Title: Re: IDEA: Right-Click Menu Create Folder with Enhancements
Post by: skwire on July 15, 2010, 03:23 PM
Ask for the new folder name
Create that new folder under the current folder

Easily done to this part.

Change to the newly created subfolder
Create an empty text file named Url.txt
Open the newly created empty text file with Notepad or the associated app for .txt files.
I copy and paste a website url into the empty text file and save it.

1) Do you literally want to see an Explorer window with the Url.txt in it?
2) If all you're doing is pasting the URL in there, why not do this all in one fell swoop e.g. when asking for the folder name, if a URL is present on the clipboard, append that automatically to Url.txt and be done with it.  No need to show an Explorer window or even the Url.txt file.

Your thoughts?

Title: Re: IDEA: Right-Click Menu Create Folder with Enhancements
Post by: GoodGuy98 on July 15, 2010, 07:46 PM
Yes I need to see the Explorer window because I also store the actual file(s) that I downloaded from the URL.
As an example I might download a freeware program such as AceMoney Lite.

The Url.txt file contains:

http://www.mechcad.net/

http://www.mechcad.net/products/acemoney/index_lite.shtml

The actual software itself is saved as:

AceMoney Lite Ver 4.2.1 (AceMoneyLiteSetup).exe

This way I can check for updates, further documentation, etc.

Thanks
Title: Re: IDEA: Right-Click Menu Create Folder with Enhancements
Post by: skwire on July 15, 2010, 08:12 PM
Any idea what you'd like for the menu entry text?
Title: Re: IDEA: Right-Click Menu Create Folder with Enhancements
Post by: GoodGuy98 on July 15, 2010, 08:58 PM
How about..

Create Subfolder
Title: Re: IDEA: Right-Click Menu Create Folder with Enhancements
Post by: GoodGuy98 on July 27, 2010, 01:17 PM
Is there any progress on this or is what I asked not worth the effort it would require?
I am not sure how this procedure works.
Title: Re: IDEA: Right-Click Menu Create Folder with Enhancements
Post by: skwire on July 27, 2010, 04:15 PM
Apologies, I was on holiday last week.  I'll get started on this.   :D
Title: Re: IDEA: Right-Click Menu Create Folder with Enhancements
Post by: skwire on July 27, 2010, 07:10 PM
Give this a shot:  Download (http://skwire.dcmembers.com/apps/snacks/CreateSubfolder.zip)

Put it in its own folder and run CreateSubfolder.exe directly once to register the shell extension. After that, right-click a folder and choose "Create Subfolder" from the context menu.

@Vista/Win7 users:  You will almost certainly have to run this in administrator mode.
Title: Re: IDEA: Right-Click Menu Create Folder with Enhancements
Post by: GoodGuy98 on July 28, 2010, 12:32 PM
I gave it a try and it looks very good!

I would like to make a few suggestions/notes, none of which are a big deal.

It would be nice if the new Windows Explorer window opened in the same state as the original one.
In my case, I usually have the original window maximized because my vision isn't the greatest. The
newly created window opened in normal state rather than maximized. If it would be a hassle to copy
the state, it's not worth too much effort. If it was just as easy to open maximized instead of normal
sized, I would prefer that.

It would be nice if the original window was closed after the new subfolder was created. Currently it
left the original window open, so I manually close it. If you think some people would prefer the original
window stay open, maybe a checkbox could be added to the Create Subfolder dialog defaulting to
Close.

This is really nitpicking, but all my existing URL files are named Url.txt rather than URL.txt.
I can manually change the case, but if you could change it to Url.txt it would save me the extra step.

Thanks for the program,
Title: Re: IDEA: Right-Click Menu Create Folder with Enhancements
Post by: skwire on July 30, 2010, 09:49 AM
Please try this build: Download (http://skwire.dcmembers.com/apps/snacks/CreateSubfolder.zip)

It would be nice if the new Windows Explorer window opened in the same state as the original one.

I've changed the behaviour to simply shell navigate the existing window instead of opening a new one and closing the old one.  Hopefully, this method will appear much more elegant to you.

This is really nitpicking, but all my existing URL files are named Url.txt rather than URL.txt.
I can manually change the case, but if you could change it to Url.txt it would save me the extra step.

Fixed.

Thanks for the program,

You're welcome.  =]
Title: Re: IDEA: Right-Click Menu Create Folder with Enhancements
Post by: GoodGuy98 on July 30, 2010, 09:04 PM
It is exactly what I was hoping for, so thanks again!

Please enjoy the donation.

I don't know if I should mark this thread solved or is that something you would do?

Title: Re: IDEA: Right-Click Menu Create Folder with Enhancements
Post by: skwire on July 30, 2010, 09:25 PM
It is exactly what I was hoping for, so thanks again!

That's great to hear.  I assume it's working well for you?

Please enjoy the donation.

Thank you very much.  I appreciate it.

I don't know if I should mark this thread solved or is that something you would do?

I'll take care of it.  =]
Title: Re: DONE: Right-Click Menu Create Folder with Enhancements
Post by: GoodGuy98 on July 30, 2010, 10:10 PM
That's great to hear.  I assume it's working well for you?

Yes it is doing exactly what I wanted it to do. It'll be a real timesaver.

Thank you for moving it.