how to run a batch at remote computer from asp.net?
-
hi, I have a batch file in a shared directory at a network(LAN) pc, I have read, write and execute rights at that directory. I want to run that batch file from my pc(at same network as target pc) I an at an asp.net page(opened in Internet explorer) I can browse that batch file and can press a button to run that batch file. how it can be done... using webservice? using windows scripting(WMI OR WSH)? OR ?????????????????????????????????????? please reply if any Gru knows..
-
hi, I have a batch file in a shared directory at a network(LAN) pc, I have read, write and execute rights at that directory. I want to run that batch file from my pc(at same network as target pc) I an at an asp.net page(opened in Internet explorer) I can browse that batch file and can press a button to run that batch file. how it can be done... using webservice? using windows scripting(WMI OR WSH)? OR ?????????????????????????????????????? please reply if any Gru knows..
Hi there, Basically, you can use Windows Script Host model to create a WshShell object whose the Run method can be used to run a batch file. In addition, you can make use of the System.Diagnostics.Process class, it's supposed to be a better way IMO. However, what you also need to pay your attention to is the permission issue. You may find this blog Run a .BAT file from ASP.NET [^] helpful to you, it also includes the sample code in there. For more information, you can see Process Class[^]