| | |
call cmd processes and keeping them cmd window
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2007
Posts: 10
Reputation:
Solved Threads: 1
I've been able to call a cmd process to run a batch file. It runs but I have no idea what it does bec' the window opens and closes too fast. I've used .WaitForExit(), but it doesn't help. I've been looking for more help and can find anything specific. I can't tell if my batch file runs or not and where the output redirects too. Any help would be greatly appreciated. Thanks.
Gabe
Gabe
You remind me with graduation project days 

C# Syntax (Toggle Plain Text)
public void GenerateKeyFile(string command) { ProcessStartInfo PSI = new ProcessStartInfo("cmd.exe"); PSI.RedirectStandardInput = true; PSI.RedirectStandardOutput = true; PSI.RedirectStandardError = true; PSI.UseShellExecute = false; Process p = Process.Start(PSI); System.IO.StreamWriter SW = p.StandardInput; System.IO.StreamReader SR = p.StandardOutput; SW.WriteLine(command); SW.Close(); }
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- Execute file in server after window is closed (PHP)
- Cmd.exe not working (Windows NT / 2000 / XP)
- Network cable is un-plugged! No it isn't. (Networking Hardware Configuration)
- Using Global Low-Level Hooks Without Using A Dll (Computer Science)
- Can't remove ColdFusion Trojan (Viruses, Spyware and other Nasties)
- PHP .tpl format template help! URGENT! (PHP)
- i want the user to enter an input without obligating him to press enter (C++)
- My ie keeps adding favorites w/out my permission and . . . (Web Browsers)
- GDI (C)
Other Threads in the C# Forum
- Previous Thread: open file in same folder as application
- Next Thread: Displaying an XML table
| Thread Tools | Search this Thread |
.net access algorithm api array asp.net barchart bitmap box broadcast buttons c# check checkbox client combobox control conversion csharp custom database databaseconnection datagrid datagridview dataset datetime dbconnection degrees design development draganddrop drawing encryption enum event eventhandlers excel file firefox form format forms function gdi+ httpwebrequest image index input install java label libraries list listbox loop mandelbrot math mouseclick movingimage mysql mysql.data.client operator path photoshop php picturebox pixelinversion post programming radians regex remote remoting resourcefile richtextbox server sleep socket sql statistics stream string study system.servicemodel table tcpclientchannel text textbox thread time timer update usercontrol validation visualstudio webbrowser windows winforms wpf xml






