c# - Is it possible to embed a bat file in .exe and use it with the Process class? -
i've created batch file being used process. have application pointing directory on local machine.
rather having bundle exe batch, embed resource contained in exe. possible batch file?
processstartinfo startinfo = new processstartinfo() startinfo.filename = "c:\test\batchfile.bat"; // set , execute batch file various arguments i've added batch file solution, , added "resource" project file. i'm not entirely sure way go, or how access in project.
as embedding batch file - can embed if need be... answer yes :-)
as how use embedded batch file - easiest option read resource (see http://msdn.microsoft.com/en-us/library/system.resources.resourcemanager.aspx , http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getmanifestresourcestream.aspx) , save real file - use that.
if embed .net exe/dll use without saving real file... batch file suspect need save real file.
Comments
Post a Comment