使用WScript.Shell,svn dump失败

时间:2021-10-26 22:38:06
var WshShell = new ActiveXObject("WScript.Shell");
var commandLine = "svnadmin dump " + repoFullPath + " > " + repoName + ".dumpfile";
WshShell.Exec(commandLine)

I am trying to run above cscript in Windows but it seems like, it's doing nothing. It doesn't create the dump file.

我试图在Windows上运行上面的cscript,但似乎,它什么也没做。它不会创建转储文件。

Any mistake that I am doing?

我正在做的任何错误?

2 个解决方案

#1


You have not assigned values to repoFullPath or repoName. Before the Exec line, put

您尚未为repoFullPath或repoName分配值。在Exec行之前,放

WScript.Echo(commandLine);

so that you can see what the script is trying to run.

这样你就可以看到脚本试图运行的内容。

#2


Create a new command interpreter for your command using cmd, and have it terminate when done using the /C flag.

使用cmd为您的命令创建一个新的命令解释器,并在使用/ C标志完成时终止它。

For example:

commandLine = "cmd /C svnadmin dump " + repoFullPath + " > " + repoName + ".dumpfile";

#1


You have not assigned values to repoFullPath or repoName. Before the Exec line, put

您尚未为repoFullPath或repoName分配值。在Exec行之前,放

WScript.Echo(commandLine);

so that you can see what the script is trying to run.

这样你就可以看到脚本试图运行的内容。

#2


Create a new command interpreter for your command using cmd, and have it terminate when done using the /C flag.

使用cmd为您的命令创建一个新的命令解释器,并在使用/ C标志完成时终止它。

For example:

commandLine = "cmd /C svnadmin dump " + repoFullPath + " > " + repoName + ".dumpfile";