3

Is there a way to automatically add/include new files/folders into a Visual Studio project or to add/include them using a command line tool?

1 Answer 1

2

You can access Visual Studio automation from VB Script. See the following sample .vbs file that can be run as an executable:

Dim dte Dim project Set dte = CreateObject("VisualStudio.DTE.11.0") dte.Solution.Open("C:\Users\sv\Documents\Visual Studio 2012\Projects\ConsoleApplication1\ConsoleApplication1.sln") For Each project In dte.Solution.Projects If project.Name = "ConsoleApplication1" Then project.ProjectItems.AddFromFile("C:\Users\sv\Documents\Visual Studio 2012\Projects\ConsoleApplication1\ConsoleApplication1\1.txt") project.Save(project.FullName) End If Next dte.Solution.Close() 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.