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 file

How to run a batch file

Scheduled Pinned Locked Moved ASP.NET
2 Posts 2 Posters 0 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.
  • D Offline
    D Offline
    dwaravijaykumar
    wrote on last edited by
    #1

    Hi, I have a batch file(test.bat) i wrote a command to rename a text file in this batch file. Both batch file and text files are in Network Shared Drive. I am trying to run that batch file from ASP.NET application using VB.NET as a code behind. The following is the code i wrote, Dim p as new ProcessStartInfo p.WorkingDirectory = "\\networkSharedDrive\SharedFolder\" p.FileName = "testcab.bat" p.UseShellExecute = True Process.Start(p) This code is executing fine, It is not giving any error also. But the text file name is not changing. When i directly double clicking on that Batch file the name of the text file is changed that means, batch file is executing fine. But Through the above code it is not working..... Any ideas....pls help me...... Vijay Kumar

    A 1 Reply Last reply
    0
    • D dwaravijaykumar

      Hi, I have a batch file(test.bat) i wrote a command to rename a text file in this batch file. Both batch file and text files are in Network Shared Drive. I am trying to run that batch file from ASP.NET application using VB.NET as a code behind. The following is the code i wrote, Dim p as new ProcessStartInfo p.WorkingDirectory = "\\networkSharedDrive\SharedFolder\" p.FileName = "testcab.bat" p.UseShellExecute = True Process.Start(p) This code is executing fine, It is not giving any error also. But the text file name is not changing. When i directly double clicking on that Batch file the name of the text file is changed that means, batch file is executing fine. But Through the above code it is not working..... Any ideas....pls help me...... Vijay Kumar

      A Offline
      A Offline
      APDevelop
      wrote on last edited by
      #2

      Hello Vijay, Earlier I was also stuck on this issue. What I have figured out was that there were some unattended processes which are making this happen. I tried a lot however was unable to resolve this issue. There is a nice workaround available on this link: http://codebetter.com/blogs/brendan.tompkins/archive/2004/05/13/13484.aspx This workaround has always worked at my end and I hope so it will work for you also. Regards, Amit Pal

      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