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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With