0

Suppose I opened command prompt in my system and now I want to pass a command through c# program to that open command prompt window only and i dont want to open new instance of command prompt window to execute the command which I am passing through C# program.

PraveenVenu
  • 8,217
  • 4
  • 30
  • 39
arun
  • 57
  • 2
  • 9

3 Answers3

0

I'm not quite sure what you mean "open new instance" to execute arguments which you passed already. However, if you are not quite sure how to parse intensively command line arguments you can take a reference of this link :

Best way to parse command line arguments

Community
  • 1
  • 1
cat916
  • 1,363
  • 10
  • 18
0

You need to send keys to an open application. The belolw link will help you

http://www.codeproject.com/Articles/18366/Sending-Keystrokes-to-another-Application-in-C

PraveenVenu
  • 8,217
  • 4
  • 30
  • 39
0

You can try using FindWindow API and SendKeys.

Anuraj
  • 18,859
  • 7
  • 53
  • 79