Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to run a batch at remote computer from asp.net?

how to run a batch at remote computer from asp.net?

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadmintutorialquestion
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    munawarhussain
    wrote on last edited by
    #1

    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..

    M 1 Reply Last reply
    0
    • M munawarhussain

      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..

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      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[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups