从程序中运行vssadmin

时间:2012-08-05 16:14:52

标签: c++ volume-shadow-service writers

我正在尝试从c ++程序运行以下命令:

system("vssadmin list writers > tmp.txt ");

我收到了这个输出:

 "vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (C) Copyright 2001-2005 Microsoft Corp.

Error: A Volume Shadow Copy Service component encountered an unexpected error. Check the Application event log for more information.

在事件日志中有2个错误:22和8193。

如果我直接从命令行运行它,它可以正常工作。

感谢。

1 个答案:

答案 0 :(得分:1)

问题是我在64位计算机上运行32位应用程序,因此Windows将应用程序重定向到错误的vssadmin。

http://msdn.microsoft.com/en-us/library/aa384187

http://msdn.microsoft.com/en-us/library/aa365743