yokzu

yokzu

  • NA
  • 306
  • 0

Using command line(cmd.exe)

May 26 2011 8:53 AM
hello,
I want to use windows' command line(cmd.exe) and executing some commands from there. But I couldnt send 2 or more parameter. My all codes are below;

-------------------------
            string parametre1 = "telnet"
            Process islem = new Process();
            islem.StartInfo.FileName = "C:\\Windows\\System32\\cmd.exe";
            islem.StartInfo.Arguments = parametre1;
            islem.StartInfo.RedirectStandardOutput = true;
            islem.StartInfo.UseShellExecute = false;
            islem.Start();
            islem.WaitForExit();
            string output = islem.StandardOutput.ReadToEnd();
            textBox1.text = output;

            string snmp_parametre2 = "telnet 11.11.11.11"
            ...
------------------------

How can I execute "telnet.exe" and send parameters to it? Then how can I send more parameters?
---------
telnet 11.11.11.11
user:admin
pass:12345
...
---------


Answers (12)