检查映射的驱动器是否也为帐户T:
正确映射。Administrator
另外,我不确定,但管理员可能必须登录才能使用映射的驱动器。
您还可以尝试以下操作,启动cmd.exe
、映射您的 UNC 路径,然后调用应用程序:
var password = new SecureString();
password.AppendChar(Convert.ToChar("P"));
password.AppendChar(Convert.ToChar("a"));
password.AppendChar(Convert.ToChar("a"));
password.AppendChar(Convert.ToChar("s"));
var startInfo = new ProcessStartInfo();
startInfo.FileName = "cmd.exe";
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardOutput = true;
startInfo.UserName = "Administrator";
startInfo.Password = password;
startInfo.Domain = "domain";
var process = Process.Start(startInfo);
process.BeginOutputReadLine();
process.StandardInput.WriteLine(@"pushd \\your_unc_path\ca");
process.StandardInput.WriteLine("test.exe");
process.StandardInput.WriteLine("exit");
process.WaitForExit();