locked
How to execute or run batch file in asp.net (client server machinisim) ? RRS feed

  • Question

  • User1098555886 posted

    Hi 

       How execute batch file form client machine or server machine itslef  in asp.net ? ,if i run Reboot.bat file manually it work fine,but i call that batch file from asp.net nothing happen,it simply post back the page,i mean it hit the server.i will try in lot of ways,here i post already pls read for codings what i did.

    http://www.codeproject.com/script/Answers/MemberPosts.aspx?tab=questions&mid=7874256&showall=True

    Note: it give all permissions for root folder,and i try to change 4 types of application pool identity also like localservice,localsystem,networkservice and Applicationpoolidentity and i gve permission for web cofig also but not work

    Pls reply asap

    Regards

       Aravind

    Saturday, July 26, 2014 11:29 AM

Answers

  • User1098555886 posted

    Did your solution have anything to do with ASP.NET?

    Actually i am convert batch file into service(exe) using third party tool (nssm) ,in that batch file i am write 10 secs delay and reboot code like Shutdown \r \t10 and form asp.net i strat that service.By default that service is stopped(when start system service is stopped,need to manually start),so form client manchine i will start that service and that service reboot system after 10 sec.Thatsall

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 8, 2014 6:07 AM

All replies

  • User-1360095595 posted

    Thankfully, you can't execute that code on the client machine.

    Saturday, July 26, 2014 11:31 AM
  • User-1716253493 posted
    Give a download link, ask user to download and run it.
    Saturday, July 26, 2014 11:33 AM
  • User1098555886 posted

    Give a download link, ask user to download and run it.

    Thanx for ur reply,i need to run in server machine,not in client machine,for example if i run notepad in server machine by calling form client machine it not popup window,just in background it running,(if i see in Task manager it running),like that i need to run batch file form client machine .

    Saturday, July 26, 2014 10:30 PM
  • User1098555886 posted

    Thankfully, you can't execute that code on the client machine.

    Then how it possible

      http://www.codeproject.com/Articles/18773/Run-Interactive-Command-Shell-or-Batch-Files-From

    Saturday, July 26, 2014 10:31 PM
  • User-1360095595 posted

    Process.Start(), which you can Google/bing, will allow you to execute a batch file on the server; since it seems you've now edited your question to include server. 

    Sunday, July 27, 2014 1:13 AM
  • User1098555886 posted

    MetalAsp.Net

    Process.Start(), which you can Google/bing, will allow you to execute a batch file on the server; since it seems you've now edited your question to include server. 

    Actually i mention in question client server mechanism in question ,i.e,from client machine need to call that batch file and execute or run in server machine.And also in description first line also again mention,pls read the question and description and then reply

    Sunday, July 27, 2014 10:30 AM
  • User697462465 posted

    Hi aravindforums1,

    Do you have got any error or exception, if so please post it here.

    Best Regards,
    Terry Guo

    Tuesday, July 29, 2014 3:06 AM
  • User-163012697 posted

    so whats the problem use the uncaccess to access the batch file from the m\c-> 

    UNCACCESS access=new UNCACCESS(filename,username,domain,password);
    System.diagnostics.process.start(filename);

    Tuesday, July 29, 2014 6:52 AM
  • User724169276 posted

    i mention in question client server mechanism in question ,i.e,from client machine need to call that batch file and execute or run in server machine.

    Thats impossible.You can't manipulate the server from client side.

    pls read the question and description and then reply

    It has already been answered by MetalAsp.

    Tuesday, July 29, 2014 7:07 AM
  • User1098555886 posted

    Finally i got the solution from my testing people. Thanks for ur reply

    Friday, August 8, 2014 4:39 AM
  • User-821857111 posted

    Did your solution have anything to do with ASP.NET?

    Friday, August 8, 2014 5:51 AM
  • User1098555886 posted

    Did your solution have anything to do with ASP.NET?

    Actually i am convert batch file into service(exe) using third party tool (nssm) ,in that batch file i am write 10 secs delay and reboot code like Shutdown \r \t10 and form asp.net i strat that service.By default that service is stopped(when start system service is stopped,need to manually start),so form client manchine i will start that service and that service reboot system after 10 sec.Thatsall

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 8, 2014 6:07 AM