1
con lines=x
con cols=x

These are the console commands that I want to run in my current C# Console application so that I can expand the console window above the max allowed from the

Console.SetWindowSize(x,x);

So basically I want to run a console command in my current console application.

Not in a new Process of command line.

I think i had console applications confused with command prompt(cmd)

    Console.SetWindowSize(Console.LargestWindowWidth,Console.LargestWindowHeight);

This seems like the safest way to get a better size for your application

wauk
  • 17
  • 5
  • Okay, so your question is? What have you tried so far? – akluth Apr 16 '13 at 10:10
  • Process.Start("cmd","/C copy c:\\file.txt lpt1"); – wauk Apr 16 '13 at 10:10
  • I tried to get the current process and do the start method on that – wauk Apr 16 '13 at 10:11
  • Simply use `Console.Read` or smth. like that to read in the commands, parse them and execute the proper methods associated with them. – akluth Apr 16 '13 at 10:12
  • This seems to do the trick – wauk Apr 16 '13 at 10:52
  • It's unclear what you're trying to do. Windows won't let you set the size of the console window larger than the screen. If you try, it will set the console window to the largest allowed size, and set the buffer to the size that you specify. See http://stackoverflow.com/q/4692673/56778 for more info. – Jim Mischel Apr 16 '13 at 13:23

1 Answers1

0

Use Console.ReadLine to provide a kind of command prompt and parse the data which the users enters after that. Then you can check if the user entered con lines for example and set the window dimensions based on this.

akluth
  • 8,393
  • 5
  • 38
  • 42