我被要求从C#运行以下命令:
stsadm -o gl-copylist -sourceurl "http://someurl" -targeturl "http://someurl" -includeusersecurity -haltonfatalerror -deletesource -includedescendants All –nofilecompression代码如下:
ProcessStartInfo startInfo = new ProcessStartInfo()
{
WindowStyle = ProcessWindowStyle.Normal,
FileName = "cmd.exe",
Arguments = "/C " + command,
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardOutput = true
};知道为什么吗?
gl-copylist命令是标准SharePoint STSADM命令的附加模块。这可能是原因吗?其他标准的STSADM命令在我的代码中运行。
发布于 2015-05-20 16:51:41
在分析/验证stsadm程序集中的命令行参数的方法中似乎存在错误,特别是在指定接受值的includedescendants参数时,在另一个参数之前指定另一个参数时,会发生以下错误:
命令行错误。
stsadm -o gl-copylist
-sourceurl "http://server/sourceweb/listviewpage"
-targeturl "http://server/targetweb" -includeusersecurity
-haltonfatalerror
-deletesource
-includedescendants All <- when this parameter is specified before another parameter
–nofilecompression一旦includedescendants参数被指定为的最后一个,命令就会成功执行:
stsadm -o gl-copylist
-sourceurl "http://server/sourceweb/listviewpage"
-targeturl "http://server/targetweb" -includeusersecurity
-haltonfatalerror
-deletesource
–nofilecompression
-includedescendants All https://stackoverflow.com/questions/30317698
复制相似问题