I have created .bat file for auto deployment and i want to access visual studio command propmt and run the .bat file using C# code.
Asked
Active
Viewed 105 times
1
-
1Possible duplicate of [Executing Batch File in C#](http://stackoverflow.com/questions/5519328/executing-batch-file-in-c-sharp) – 3Dave Dec 25 '16 at 16:39
-
Just add into your batch a command to execute VsDevCmd.bat first – KOLANICH Dec 25 '16 at 17:44
1 Answers
0
If you're talking about deployment processes, you're in the build, and you may want to consider using MSBuild directives; just open your project file in a text editor and add an Exec
line. I recommend using conditionals so it only executes in "release" mode, since a deployment script rarely has a place in debug builds.
To run other processes from C# code, see Process.Start
. Keep in mind this may require executing the VS Command Prompt with parameters to start your batch script.

David
- 10,458
- 1
- 28
- 40