如何使用c#将驱动器内容备份到外部存储设备(USB HDD)?
如果我们可以使用sdclt.exe
,那么参数是什么?
答案 0 :(得分:2)
这不是sdclt的工作原理。请参阅the MS article about Wbadmin您可以在何处实际执行命令行驱动的备份(依赖于sdclt)
答案 1 :(得分:0)
我发现它与wbadmin工具一起使用。为你们分享代码片段..
private static void BackUpEMMC(string targetDriveLetter)
{
try
{
LogManager.All.Info("Preparing to Backup the eMMC content on external storage drive: " + targetDriveLetter.ToUpper());
using (Process backupProcess = new Process())
{
ProcessStartInfo backupInfo = new ProcessStartInfo();
backupInfo.FileName = @"C:\\windows\\system32\\wbadmin.exe";
backupInfo.Arguments = string.Format("START BACKUP -backupTarget:{0}: -include:c: -vssFull -quiet", targetDriveLetter.Trim()[0]);
backupInfo.UseShellExecute = false;
backupProcess.StartInfo = backupInfo;
backupProcess.Start();
while (!backupProcess.HasExited)
{
System.Threading.Thread.Sleep(20000);
LogManager.All.Info("Started eMMC content backup on external storage drive: " + targetDriveLetter.ToUpper());
backupProcess.WaitForExit();
}
LogManager.All.Info("Backup eMMC content on external storage drive: " + targetDriveLetter.ToUpper() + " completed successfully");
}
}
catch (Exception ex)
{
LogManager.All.Error("Test failed during Backup eMMC content process");
LogManager.All.Error(ex.Message);
}
}