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;
}
}
If I execute this code in Console Application, - It works. If I execute this code in Windows Service I have this error:
Command Line Interface for Microsoft BLB Backup has stopped working
Problem signature: Problem Event Name: APPCRASH Application Name: wbadmin.exe Application Version: 6.0.6001.18000 Application Timestamp: 47918aed Fault Module Name: kernel32.dll Fault Module Version: 6.0.6002.18327 Fault Module Timestamp: 4cb73436 Exception Code: c0000142 Exception Offset: 00009f7d OS Version: 6.0.6002.2.2.0.274.10 Locale ID: 1033 Additional Information 1: 9d13 Additional Information 2: 1abee00edb3fc1158f9ad6f44f0f6be8 Additional Information 3: 9d13 Additional Information 4: 1abee00edb3fc1158f9ad6f44f0f6be8