0x80070422 means ERROR_SERVICE_DISABLED. It seems the Volume
Shadow Copy service is disabled on your machine. This might explain
why you get these shadow copy failures in NTBackup - so it is not
necesarily to turn them off.
Please make sure that the following services are enabled on your
machine:
- Volume Shadow Copy (VSS)
- Microsoft Software Shadow Copy Provider (SWPRV)
- Remote Procedure Call (RPCSS) - should be enabled as "Automatic"
- COM+ Event System (eventsystem)
- System Event Notification Service (sens) - should be enabled as
"Automatic"
如果上面这些服务你都启动了的后,再出错,看eventlog里,出得什么错,
如果是
卷影复制服务错误: 卷影复制写入程序 ContentIndexingService 调用例程 RegQueryValueExW 失败,状况 0x80070002 (已转换为 0x800423f4)。
那么可能是因为注册表里HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/ContentIndex/Catalogs
下面的项中Location的位置错误。
注意每个项里都要有Location。
我自己的错误是System项里没有Location。自己添加个Location REG_SZ C:/System Volume Information
这样就好了。
hobocopy,windows下面不错的可以增量备份的小工具,很不错。
此外在用hobocopy的时候碰到目录中带中文的时候就出错,发现出错,因为他在WideCharToMultiByte时,计算长度时出错误了。
他原来的用法是,
int result = ::WideCharToMultiByte(CP_OEMCP, 0, s2, s2.GetLength(), mbBuffer, s2.GetLength(), NULL, NULL);
这个有错误,应该改为,
int len = WideCharToMultiByte(CP_OEMCP, 0, s2, s2.GetLength(), NULL, 0, NULL, NULL);
LPSTR mbBuffer = new CHAR[len + 1];
int result = ::WideCharToMultiByte(CP_OEMCP, 0, s2, s2.GetLength() + 1, mbBuffer, len + 1, NULL, NULL);
这样重新编译过就好了~ ~