473,324 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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
Nov 24 '06 #1
1 907
mohq82
2
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


hey i think ur problem is the command is not executed properly ,try writing ur command in .bat file and execute it insted.
Nov 26 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Tim Stokes | last post by:
Hi all, I want to do a similar action to response.redirect ("file.htm"). But the file.htm contains some sensitive data. I have placed file.htm in a folder in the InetPub...
1
by: Bill | last post by:
I've got an application that I want to redirect to another file while keeping the location of the file hidden. In other words, WEBROOT.COM/REDIT.ASP?a=14 is going to display the contents of...
0
by: darren | last post by:
I have a perl script that I am calling from vb.net as a process. I need to get the standard output and display it in a text box. The problem I am having is that extra blank lines are being added to...
3
by: Max | last post by:
Yea this is probably a n00b question, but I haven't programmed C++ in at least 2 years and have never programmed for unix, sorry :) Anyway, I have a project in which a program is required to read...
4
by: Bill Cohagan | last post by:
I'm writing a console app (in C#) and I want to be able to redirect the standard input/output streams when it's run at a command prompt. IOW I want to support the "<" and ">" redirection syntax....
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
10
by: GreggTB | last post by:
I've got an page (LOGIN.ASPX) that receives the user's login information. During the page load, it checks the credentials against a database and, if validation is successful, creates an instance of...
6
by: darren | last post by:
I have a perl script that I am calling from vb.net as a process. I need to get the standard output and display it in a text box. The problem I am having is that extra blank lines are being added to...
5
by: Kevin Audleman | last post by:
I understand how to use the header command to redirect a page before any HTML has been loaded.However, I need to redirect after some HTML has already been loaded. is there a command that will...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.