PC Review


Reply
Thread Tools Rate Thread

Can't create text file by command line command.

 
 
Boki Digtal
Guest
Posts: n/a
 
      23rd Jul 2007
Hi All,

I want to get MAC address by command line directly.


private void Form1_Load(object sender, EventArgs e)
{
System.Diagnostics.Process Process3;
Process3 = new System.Diagnostics.Process();

String cmd = "ipconfig";

Process3 = System.Diagnostics.Process.Start(cmd, ">
mac_add.txt");

Process3.WaitForExit();
// Process3.Close();
}

but I get nothing when I perform it.

Thank you!

Best regards,
Boki.

 
Reply With Quote
 
 
 
 
=?UTF-8?B?R8O2cmFuIEFuZGVyc3Nvbg==?=
Guest
Posts: n/a
 
      23rd Jul 2007
Boki Digtal wrote:
> Hi All,
>
> I want to get MAC address by command line directly.
>
>
> private void Form1_Load(object sender, EventArgs e)
> {
> System.Diagnostics.Process Process3;
> Process3 = new System.Diagnostics.Process();
>
> String cmd = "ipconfig";
>
> Process3 = System.Diagnostics.Process.Start(cmd, ">
> mac_add.txt");
>
> Process3.WaitForExit();
> // Process3.Close();
> }
>
> but I get nothing when I perform it.
>
> Thank you!
>
> Best regards,
> Boki.
>


You are sending "> mac_add.txt" as a parameter to the program. That does
not redirect the output of the program.

Take a look at the ProcessStartInfo.RedirectStandardOutput property.

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create a shortcut (.lnk) file from command line or batch =?Utf-8?B?QmFycnk=?= Windows XP General 0 30th Aug 2006 08:28 PM
command-line way to create empty file Linda B Windows XP General 11 4th Feb 2005 05:02 AM
Is there a command line command to extract just the files within a .msi file. Lawrence Windows XP General 5 4th Nov 2004 04:27 AM
Is there a command line command to extract just the files within a .msi file. Lawrence Microsoft Windows 2000 5 4th Nov 2004 04:27 AM
Help create link or command line to copy text to clipboard Mudley Windows XP General 1 16th Jul 2003 08:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:15 AM.