我尝试在Windows Server上备份系统状态服务:
string path = "D:";
string wbadminPath = Environment.SystemDirectory + @"\wbadmin";
string wbadminEvent = "start systemstatebackup -backupTarget:" + path + " -quiet";
try
{
int exitCode = 0;
ProcessStartInfo start = new ProcessStartInfo(wbadminPath, wbadminEvent);
using (Process proc = Process.Start(start))
{
proc.WaitForExit();
exitCode = proc.ExitCode;
}
}
有效!但是当我尝试在WindowsService中运行此代码时,Windows Server会向我显示此异常:
Microsoft BLB备份的命令行界面已停止工作问题签名:问题事件名称:APPCRASH应用程序 名称:wbadmin.exe应用程序版本:6.0.6001.18000应用程序 时间戳:47918aed故障模块名称:kernel32.dll故障模块 版本:6.0.6002.18327故障模块时间戳:4cb73436异常 代码:c0000142 Exception Offset:00009f7d OS 版本:6.0.6002.2.2.0.274.10区域设置ID:1033附加信息 1:9d13附加信息2:1abee00edb3fc1158f9ad6f44f0f6be8 附加信息3:9d13附加信息 4:1abee00edb3fc1158f9ad6f44f0f6be8