Yes as per Bernhard said in solution 1, Check your array length before accessing its first index value.
Try the following
if(args.length() > 0)
{
if (args[0] == "ui")
{
Application.Run(new selectedpath.Form1());
}
else
{
Console.WriteLine("dfdd");
}
}
Regards,
BlueSathish