In order to use ternary operator, both statement should return the same type or one type should be convertible to other.See documentation:
Either the type of first_expression and second_expression must be the same, or an implicit conversion must exist from one type to the other.
You need to use simple if
statements intead, it is also more readable:
if(File.Exists("C:\\Test\\Data\\TestingPurposes\\" + UserName + "DailyInfo"))
{
pRun.StartInfo.UseShellExecute = true
}
else MessageBox.Show("Please verify that this file exists");