0
我一直在問,從C#運行以下命令:運行的SharePoint STSADM命令
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
};
命令運行在一項獨立罰款獨立的命令窗口,但始終顯示從我的控制檯應用程序運行時的標準「STSADM -o」幫助文本。
任何想法爲什麼?
gl-copylist命令是標準SharePoint STSADM命令的加載項。這可能是原因嗎?其他標準STSADM命令在我的代碼中運行。
它實際上不是順序。我使用了錯誤的連字符。用正確的替換它後,它的工作。 –