Groups | Blog | Home
all groups > visual studio .net general > february 2005 >

visual studio .net general : Can VS be controlled from a batch file?


Mitch
2/4/2005 11:54:28 AM
From a batch file, I would like to start an executable, then send a command
to visual studio (which is already running) to attach to the process that
just started.
Is this possible? Can VS be controlled in any way from a batch file?
For comparison, MacOS applications are "scriptable" and can be controlled
from a simple script file. I'm looking for anything equivalent.

Mikhail Arkhipov (MSFT)
2/6/2005 10:17:03 AM
Have a look here

http://msdn.microsoft.com/vstudio/extend/

VS has large number of public interfaces accessible from managed, unmanaged
and scripting languages. In fact, our QA team writes automated tests using
VS extensibility model.

http://www.microsoft.com/downloads/details.aspx?familyid=3ff9c915-30e5-430e-95b3-621dccd25150&displaylang=en

Lots of samples, including how to use Windows Scripting Host to drive VS.

Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights

[quoted text, click to view]

Carlos J. Quintero [.NET MVP]
2/7/2005 12:21:37 PM
Not from a .bat file, but yes from a .vbs script file once you get the DTE
root object that represents the IDE. For
example, put this code in a .vbs file and execute it:

Dim objDTE

' Create a reference to an instance of VS.NET
Set objDTE = CreateObject("VisualStudio.DTE")

' Show its version
MsgBox objDTE.Version

' Make the IDE visible
objDTE.MainWindow.Visible = True

And then, once you have the objDTE object, you can use the whole
extensibility model to do whatever you want.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com


"Mitch" <xxxxx@avantium.com> escribió en el mensaje
news:O5wpxotCFHA.3368@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button