Hopefully this will save a few of you some time: I have created a registry entry that will create file associations and commands for your NAnt .build files. It will associate .build files as “NAnt Build Files” and create two commands for right-clicking a .build file in Explorer: “Edit” will open the file in Notepad; “Run” will execute the file in NAnt using a persistent command window (the window won’t disappear when the script is finished).
NAnt Build File Associations
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.build] @=”build_auto_file” [HKEY_CLASSES_ROOT\build_auto_file] @=”NAnt Build File” “EditFlags”=dword:00000000 “BrowserFlags”=dword:00000008 [HKEY_CLASSES_ROOT\build_auto_file\shell] @=”Edit” [HKEY_CLASSES_ROOT\build_auto_file\shell\&Run] @=”Run” [HKEY_CLASSES_ROOT\build_auto_file\shell\&Run\command] @=”C:\WINDOWS\system32\CMD.EXE /k “C:\Program Files\NAnt\bin\NAnt.exe” -buildfile:%1″ [HKEY_CLASSES_ROOT\build_auto_file\shell\&Run\ddeexec] [HKEY_CLASSES_ROOT\build_auto_file\shell\&Run\ddeexec\Application] @=”NAnt” [HKEY_CLASSES_ROOT\build_auto_file\shell\&Run\ddeexec\Topic] @=”System” [HKEY_CLASSES_ROOT\build_auto_file\shell\edit] @=”&Edit” [HKEY_CLASSES_ROOT\build_auto_file\shell\edit\command] @=”C:\WINDOWS\system32\NOTEPAD.EXE %1″ [HKEY_CLASSES_ROOT\build_auto_file\shell\edit\ddeexec] [HKEY_CLASSES_ROOT\build_auto_file\shell\edit\ddeexec\Application] @=”NOTEPAD” [HKEY_CLASSES_ROOT\build_auto_file\shell\edit\ddeexec\Topic] @=”System”
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.build] @=”build_auto_file”
[HKEY_CLASSES_ROOT\build_auto_file] @=”NAnt Build File” “EditFlags”=dword:00000000 “BrowserFlags”=dword:00000008
[HKEY_CLASSES_ROOT\build_auto_file\shell] @=”Edit”
[HKEY_CLASSES_ROOT\build_auto_file\shell\&Run] @=”Run”
[HKEY_CLASSES_ROOT\build_auto_file\shell\&Run\command] @=”C:\WINDOWS\system32\CMD.EXE /k “C:\Program Files\NAnt\bin\NAnt.exe” -buildfile:%1″
[HKEY_CLASSES_ROOT\build_auto_file\shell\&Run\ddeexec]
[HKEY_CLASSES_ROOT\build_auto_file\shell\&Run\ddeexec\Application] @=”NAnt”
[HKEY_CLASSES_ROOT\build_auto_file\shell\&Run\ddeexec\Topic] @=”System”
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit] @=”&Edit”
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit\command] @=”C:\WINDOWS\system32\NOTEPAD.EXE %1″
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit\ddeexec]
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit\ddeexec\Application] @=”NOTEPAD”
[HKEY_CLASSES_ROOT\build_auto_file\shell\edit\ddeexec\Topic] @=”System”
Use this code/file at your own risk. I offer it as is, without any support. By downloading this file or using this code you take full responsibility for any repercussions that it may have on your computer.
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.