locked
Help regarding Web Service RRS feed

  • Question

  • User992700523 posted

    Asalam Alaikum(Greetings)!

    I have a question about the web services. I create a web service on my system. in which i run a batch file on my root directory of C. When i run service the bat file is running. My question is that if i call web service from other PC, will my bat file run through my service or not.

    Thank you,

    Regards,
    Muhammad Naveed Haroon

    Tuesday, September 11, 2018 1:14 PM

Answers

  • User36583972 posted


    Hi Muhammad Naveed Haroon,

    I have a question about the web services. I create a web service on my system. in which i run a batch file on my root directory of C. When i run service the bat file is running. My question is that if i call web service from other PC, will my bat file run through my service or not.

    Form your description, do you want to run a bat file from your Web Service on the servier machine when someone call your web service from other PC?

    As far as I know, In asp.net we can use System.Diagnostics.Process class to run the .bat file.

    But, it we need to run the process under the Administartor account or the account which has the access to run the batch file.

    You can refer the following links.

    Launching an executable in a Web Service

    How can i run a .bat file from asp.net in the server side


    but also may be the IIS will block it for some security purpose. So we can try another way for running .bat file in server side.

    The following way for your reference.

    How to execute or run batch file in asp.net (client server machinisim

    Best Regards,

    Yong Lu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 12, 2018 2:23 AM