0

I have a WCF Service that will execute a batch file. However, I don't want that batch file to be visible/editable by the user. Is there any way I can embed the batch file code into my service (perhaps in a method).

Currently I am using

System.Diagnostics.Process.Start(myBatchFileName);

to launch my .bat file but as I mentioned, is visible to users.

Hector
  • 1
  • 4

1 Answers1

0

There is an example here explaining how to execute individual Windows shell commands through C#, without having to create/open a batch file:

https://stackoverflow.com/a/21295585/2661795

I've successfully used this method to execute multiple commands in a row, effectively mimicking the functionality of a batch file without having to expose a batch file to the user.

Community
  • 1
  • 1