|
Call a .bat file from my App Posted: 13 Nov 2009 10:25 AM |
I have a number of .Bat files I would like to run from my application on a timer. I'm using VS2005 and each batch file would execute from a different timer. I want the file to run, and the command window it creates to be invisible to the user. The end result is that the batch files run without any interaction from the user, but for now, as long as I can run them from my app, I can figure the rest out later.
Thanks! |
|
|
 |
|
|
|
vulpes
|
 |
| Joined: 30 Apr 2007 |
| Total Posts: 6800 |
| |
|
Re: Call a .bat file from my App Posted: 13 Nov 2009 11:09 AM |
The code to run a batch file invisibly would be something like this:
using System.Diagnostics;
// ....
Process p = new Process();
string batPath = @"c:\myfiles\myfile.bat";
p.StartInfo.FileName = batPath;
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.Start(); |
|
|
 |
|
|
Re: Call a .bat file from my App Posted: 13 Nov 2009 12:33 PM |
| Which Using statement are you using for that process instantiation? |
|
|
 |
|
|
Re: Call a .bat file from my App Posted: 13 Nov 2009 12:43 PM |
| found it, nevermind. |
|
|
 |
|