How to execute batch file sequentially from C# wcf service?

Yosuva

New member
Joined
Nov 9, 2020
Messages
1
Programming Experience
5-10
I'm trying to execute same batch file sequentially with different input parameters from C# wcf service using Mutex variable. It's not working as expected. Basically wcf service will be getting multiple request from client users application to execute batch file at the same time, i shouldn't execute the batch file parallelly instead I have to process the requests sequentially one by one.

i tried multiple ways to achieve this. But i couldn't able to do it. can anyone tell how to implement this using C#.NET? Any sample code would be more helpful for me?

Thanks in advance
 
"WCF service" or did you really mean "web service"?

Since WCF is a desktop UI framework, on Windows desktop clients, only one user can use the desktop UI at a time so you won't end up with multiple simultaneous users, and won't have the problem you are describing. (Windows Terminal Server is another ball of wax that allows multiple users, but they should be isolated from each other.
 
If your WCF service is hosted under IIS you'll need to ensure the AppPool has the correct user and permissions assigned to execute the batch file.
 
Back
Top Bottom