svn dump fails with WScript.Shell

只愿长相守 提交于 2019-12-06 14:46:18

问题


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?


回答1:


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.




回答2:


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";


来源:https://stackoverflow.com/questions/445121/svn-dump-fails-with-wscript-shell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!