svn dump fails with WScript.Shell

2019-04-15 19:10发布

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.

Any mistake that I am doing?

2条回答
啃猪蹄的小仙女
2楼-- · 2019-04-15 19:21

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

For example:

commandLine = "cmd /C svnadmin dump " + repoFullPath + " > " + repoName + ".dumpfile";
查看更多
ゆ 、 Hurt°
3楼-- · 2019-04-15 19:38

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

WScript.Echo(commandLine);

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

查看更多
登录 后发表回答