【发布时间】:2016-01-15 07:08:07
【问题描述】:
我需要使用 C# 代码备份 Windows 数据及其设置。
为了实现目标,我运行以下命令:
Wbadmin start backup
命令的SOURCE
问题:
- 此命令不适用于所有版本的 Windows。
请求
还有其他可靠的方法来备份 Windows 数据和设置。
【问题讨论】:
我需要使用 C# 代码备份 Windows 数据及其设置。
为了实现目标,我运行以下命令:
Wbadmin start backup
命令的SOURCE
问题:
请求
还有其他可靠的方法来备份 Windows 数据和设置。
【问题讨论】:
Wbadmin 从事以下工作:
Windows Vista 视窗服务器 2008 Windows 7的 视窗 8 视窗 10 视窗服务器 2008 R2 视窗服务器 2012
这是一个非常标准的推荐解决方案。除此之外,您还遇到了什么问题?
【讨论】:
您应该能够使用类似场景 #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.
【讨论】: