Search code examples
c#windowsvisual-studio-2017console-applicationwindows-server

How to set C# Console Application to use default console settings (Windows Server 2012)?


Created a console application using C#/Visual Studio 2017. When I run the console application from VS or on a Windows 10 machine, it uses the default settings for my console application (Options/Font/Layout/Colors) which is perfect. However when I try to run it on a Test Server using Windows Server 2012 R2, it uses random settings (small buffer size/large font/odd shaped window). I've tried:

  • Setting Defaults on Server(2012) to same defaults on Local (Windows 10/VS)
  • Programmatically setting features of console window
  • Running from Command Line

When I run the application from command line(program.exe), it uses the default settings. But when I click on the executable it does not. What am I missing here?


Solution

  • Apparently there's two different settings for the console. One for the User Account and another for initial console window title(in this case my application). I was able to look at the settings within Regedit.exe, HCKU/Console key and remove the settings for my initial console window title and then ran application (as admin) and changed the defaults there. Thank you for the comments!