I have two account's on my PC, an admin account an user account. User account has admin privileges to install new programs. I usually work with my user account. When I want to install a SQL Server service pack 3 for SOL Server 2008, the UAC window prompts me to click yes or no to continue installation.
I don't want that to happen. I need no interruption during my installation. How can I suppress that UAC message box ?
I am calling a .BAT
file from my C# program. This is the command line:
start /WAIT C:\Temp\SQLSP3.exe /quiet
/IAcceptSQLServerLicenseTerms /Action=Patch /AllInstances
Following is the UAC prompt. Please help me in supressing this.
This is the C# code to elevate the BAT file execution with Admin Credentials.
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = windrive + @"temp\SQLSP3.BAT";
p.StartInfo.Arguments = DateTime.Now.ToShortDateString().ToString().Replace('/', '-') + ".db";
p.StartInfo.UserName = "Admin";
SecureString adminpassword = new SecureString();
adminpassword = ConvertToSecureString(Password);
p.StartInfo.Password = adminpassword;
try
{
p.Start();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.InnerException);
Console.ReadLine();
}