3

I am beginner in using batch files.

I have added visstudio system variable with value C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe

So echo %visstudio% will give me the path of Visual Studio in cmd.

Now how could I use this variable so that I can run application from my batch files? I need this as I have multiple projects and I don't want to move in folders.

@echo off
start %visstudio% "%cd%\Src\Edge\Test\Edge.Test.sln"

Earlier I used to do like:

@echo off
start "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" "%cd%\Src\Edge\Test\Edge.Test.sln"

If I update Visual Studio then I again need to change the VS paths in all batch files, and that nobody will like.

1 Answer 1

3
start "window name - can be empty but not omitted" "%visstudio%" "%cd%\Src\Edge\Test\Edge.Test.sln"

start interprets the first "quoted parameter" as a window title. It can be empty.

The executable needs to be in quotes since it contains spaces.

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.