【问题标题】:How to take Windows and Data Backup Programmatically?如何以编程方式进行 Windows 和数据备份?
【发布时间】:2016-01-15 07:08:07
【问题描述】:

我需要使用 C# 代码备份 Windows 数据及其设置。

为了实现目标,我运行以下命令:

Wbadmin start backup 

命令的SOURCE

问题:

  1. 此命令不适用于所有版本的 Windows。

请求

还有其他可靠的方法来备份 Windows 数据和设置。

【问题讨论】:

    标签: c# windows cmd


    【解决方案1】:

    Wbadmin 从事以下工作:

    Windows Vista 视窗服务器 2008 Windows 7的 视窗 8 视窗 10 视窗服务器 2008 R2 视窗服务器 2012

    这是一个非常标准的推荐解决方案。除此之外,您还遇到了什么问题?

    【讨论】:

    • 感谢您的回复。我很遗憾地告诉您,使用System State Backup 不起作用。除了命令行 - CMD 之外,Wbadmin 还有其他选择吗?
    【解决方案2】:

    您应该能够使用类似场景 #2 的内容:

    https://technet.microsoft.com/en-us/library/cc742083(v=ws.11).aspx

    wbadmin start backup –backupTarget:d: -include:g\folder1,h:\folder2 –systemstate -vsscopy
    

    注意语法部分也是个好主意

    Windows Vista 和 Windows Server 2008 的语法:

    wbadmin start backup
    [-backupTarget:{<BackupTargetLocation> | <TargetNetworkShare>}]
    [-include:<VolumesToInclude>]
    [-allCritical]
    [-noVerify]
    [-user:<UserName>]
    [-password:<Password>]
    [-noinheritAcl]
    [-vssFull]
    [-quiet]
    

    Windows 7 和 Windows Server 2008 R2 及更高版本的语法:

    Wbadmin start backup
    [-backupTarget:{<BackupTargetLocation> | <TargetNetworkShare>}]
    [-include:<ItemsToInclude>]
    [-nonRecurseInclude:<ItemsToInclude>]
    [-exclude:<ItemsToExclude>]
    [-nonRecurseExclude:<ItemsToExclude>]
    [-allCritical]
    [-systemState]
    [-noVerify]
    [-user:<UserName>]
    [-password:<Password>]
    [-noInheritAcl]
    [-vssFull | -vssCopy] 
    [-quiet]
    

    在某些情况下,您可能需要检测操作系统并运行wbadmin start systemstatebackup。您可能会注意到,Windows Vista 和 Windows Server 2008 中缺少 systemState 标志。还需要注意的是,wbadmin start systemstatebackup 在 Windows 10 上不起作用,您会看到以下消息:

    Warning:  The DELETE SYSTEMSTATEBACKUP command is not supported in this version of Windows.
    The operation ended before completion.
    

    【讨论】:

      猜你喜欢
      • 2021-08-11
      • 1970-01-01
      • 2011-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-21
      相关资源
      最近更新 更多