redirect the contents of the command to a file
-
Hi , I need to redirect the contents of the command to a file. I tried doing this using follwing peice of code but it doesnt seem to be working. System.Diagnostics.Process QueryProcess = new System.Diagnostics.Process(); String command = @"ipconfig/all"; QueryProcess.StartInfo.FileName = command; QueryProcess.StartInfo.Arguments = " >c:\\a.txt"; QueryProcess.Start(); QueryProcess.Close(); Kindly look into the problemand tell me the solution ASAP. Thanks and Regards, Sankalp Verma
Sankalp Verma
-
Hi , I need to redirect the contents of the command to a file. I tried doing this using follwing peice of code but it doesnt seem to be working. System.Diagnostics.Process QueryProcess = new System.Diagnostics.Process(); String command = @"ipconfig/all"; QueryProcess.StartInfo.FileName = command; QueryProcess.StartInfo.Arguments = " >c:\\a.txt"; QueryProcess.Start(); QueryProcess.Close(); Kindly look into the problemand tell me the solution ASAP. Thanks and Regards, Sankalp Verma
Sankalp Verma
You could always stream the
StandardOutput
to a file - See the docs on MDSN for theSystem.Diagnostics.Process
class
Upcoming Scottish Developers events: * We are starting a series of events in Glasgow in 2007. Are you interested in a particular subject, or as a speaker? * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog | Photos
-
Hi , I need to redirect the contents of the command to a file. I tried doing this using follwing peice of code but it doesnt seem to be working. System.Diagnostics.Process QueryProcess = new System.Diagnostics.Process(); String command = @"ipconfig/all"; QueryProcess.StartInfo.FileName = command; QueryProcess.StartInfo.Arguments = " >c:\\a.txt"; QueryProcess.Start(); QueryProcess.Close(); Kindly look into the problemand tell me the solution ASAP. Thanks and Regards, Sankalp Verma
Sankalp Verma