Handy context menu item
Heres another little thing that I’ve done recently to make my life a little bit easier. I added a custom context menu item for my NAnt build files so that I can right click them, and build them from explorer. Here a screenshot:
Here’s how you can do this (this works for any file type and custom action you want):
1. Go to the “Tools” menu and select the “Folder Options” item in any explorer window.
2. Select the “File Types” tab.
3. You should see a box with all your registered file types on your system, locate the .build extension. If it doesn’t exist, create it using the “New” button that you see.
4. After selecting the .build extension, click the “Advanced” button towards the bottom.
5. You should see a list of actions for this file type, click the “New” button.
6. In the “Action” field, put “Build This!” or anything else you want. For the “Application used to perform action” browse to your nant.exe file, wherever you installed it to. If there are spaces in the path, make sure to enclose the entire string in quotes.
7. Outside the quotes, add this to the end of your path, “-buildfile:%1” (without the quotes). This tells nant.exe to build the file that you’ve right clicked.
8. Click OK on all the windows, close them, and you’re all set to build from the context menu!
Now, someone could get really rad and create a whole sub-context menu with a bunch of different nant command line options. All we did was add the -buildfile option, but maybe you want to have a Debug settings, Release settings, etc, etc. It could get pretty cool. So someone do that and then let me have it :-).
Anonymous said,
Wrote on July 19, 2005 @ 5:01 am
Ya I got very similar context menu. Here is a screenshot.
I mostly use to get projects out from source safe and build it. I got 4 Menus. 1st one is “Open” which will open build file in notepad. 2nd one is “Build”, which builds the project. 3rd one is “Clean Build”, It delete all the project files from harddisk and get latest version from Sourcesafe and build it. and last one is “Latest Build” which gets latest copy of the project from source safe and build it. Its so Handy because opening large solution with 15-20 projects and building it takes so long.
breichelt said,
Wrote on July 19, 2005 @ 7:23 am
Mihir, the link to your screenshot redirect me to the image shack homepage, your menu sounds cool, I’d like to see the screenshot
Anonymous said,
Wrote on July 19, 2005 @ 8:56 am
here is the link … http://img308.imageshack.us/img308/8499/ss7fl.png
breichelt said,
Wrote on July 20, 2005 @ 8:19 am
Mihir, thats exactly what I had in mind, pretty cool!