You would want to include the .bat file as an embedded resource. So in Visual Studio you would open up the Properties on the file, and select "Embedded Resource" for the "Build Action".
Now for the fun part....in your app you'll want to extract the file and write it to disk prior to executing using the GetManifestResourceStream
method on the Assembly object. This is slightly tricky because you need to pass a resource name to the method, and that name ends up being based on your assemblies namespace, plus the path (so if your project is MyProject
and your file in in Resources\MyBat.bat
then the resource name would be MyProject.Resources.MyBat.bat
...at least I think thats right)
There is actually an existing SO question about how to do this here, and has a much nicer code sample than the one I was going to whip up. :)