VS プロジェクトで管理者としてバット ファイルを実行したいと考えています。バットファイルにはいくつかのコマンドがあり、そのファイルを実行したいです。これらのコマンドには管理者権限が必要です。コードは下にあります。
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;
}
これらのコマンドを実行する方法や、このファイルを管理者モードで実行する方法を教えてください。あらゆる種類のヘルプをいただければ幸いです。よろしくお願いします