static void Main(string[] args) { CustomFManager customF = new CustomFManager(); if (args != null && args.Length > 0) //If there's an argument in the execution. { string funkeyCodeNum = args[0]; customF.setFunkey(funkeyCodeNum); } else { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } }