Call a .bat file from my App C# Friends
http://www.csharpfriends.com
World's Greatest C# Community    
Home Articles C# Forums Books C# Syntax C# Spec C# Jobs free Source Code Advertise About
 

Control Panel

[ Sign In / register ]
Points   
Notes 
My Forums
My Tutorials
My Profile

Resources

Learn
 Articles
 QuickStarts
 C# Spec
 Whitepapers
 Tools
 Class Browser
 C# Code Generator
 Links
 Misc Rss Feeds
 Code Highlight
 411 Directory
 FREE magazines
 freevb.net

Reviews
  ASP.NET Hosting

Source Code
 Get Version 1.0



C# Consulting
AspDotNetStoreFront

C# Forums Home   Search   Login   Register   Member List  
CSharpFriends  > CSharpAspNetAnyQuestionIsOk  > Call a .bat file from my App  
 
Previous Thread :: Next Thread 
 Author Thread: Call a .bat file from my App
JVisconti is not online. Last active: 6/25/2010 7:51:20 AM JVisconti
Joined: 09 Nov 2009
Total Posts: 6
 
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 is not online. Last active: 11/13/2009 3:05:34 PM vulpes
Top 25 Poster
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();
JVisconti is not online. Last active: 6/25/2010 7:51:20 AM JVisconti
Joined: 09 Nov 2009
Total Posts: 6
 
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?
JVisconti is not online. Last active: 6/25/2010 7:51:20 AM JVisconti
Joined: 09 Nov 2009
Total Posts: 6
 
Re: Call a .bat file from my App
Posted: 13 Nov 2009 12:43 PM
found it, nevermind.
Previous Thread :: Next Thread 
Page 1 of 1
 
CSharpFriends  > CSharpFriends  > CSharpAspNetAnyQuestionIsOk  > Call a .bat file from my App  



Today's Top Movers

Yesterday Top Movers


Monthly Leaders

Top Members

Great Offers
.net hosting
Go To My Pc
Remote Pc Control
C#
ad server
snadtech GoToMyPc

Top of Page

Advertise | SiteMap | About | Link To Us | Privacy Notice Copyright © 2003 - 2005 CSharpFriends.com  All Rights Reserved  Visual C# Developer Center