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.

2

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.