I want to run a bat file in my VS project as administrator. There are some commands in the bat file and i want to execute that file. Those commands need administrator privileges. The code is given under.
AndroidSmS aHelper = new AndroidSmS();
string renameMsg = aHelper.RenameFile();
public string RenameFile() {
string renameBATPath = ConfigurationManager.AppSettings["RenameBATPath"].ToString();
string o;
string str = DateTime.Now.ToOADate().ToString();
using (var p = new System.Diagnostics.Process())
{
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = @renameBATPath;
p.StartInfo.Arguments = DateTime.Now.ToShortDateString().ToString().Replace('/', '-')+".db";
p.Start();
o = p.StandardOutput.ReadToEnd();
p.WaitForExit();
}
return o;
}
So can some please tell me how can i run these commands or run this file in administrator mode. Any type of help will be appreciated. Thanks in advance Regards