views:

356

answers:

5
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?

Thanks,

A: 

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.

RedFilter
A: 

Oh no.repoFullPath or repoName values are present. I just didn't paste it here. I can echo what WScript is going to execute.

WScript.Echo(commandLine) prints:-

Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

svnadmin dump C:\svn_repository\eMachine > C:\SubversionBackup\repositories\eMachine.dumpfile
svnadmin dump C:\svn_repository\Test > C:\SubversionBackup\repositories\Test.dumpfile

But nothing gets created in SubversionBackup\repositories folder

chandrajeet
Does the command constructed in the script, i.e.:svnadmin dump C:\svn_repository\eMachine > C:\SubversionBackup\repositories\eMachine.dumpfile work when you execute it from the command line? (Sorry to pick up on this late, I came across it while searching for something else)
Mike Woodhouse
A: 

OrbMan or somebody else can reply to this issue I am facing?

thanks

chandrajeet
A: 

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

Hi,

The solution provided by James Tikalsky worked. However why did we have to create a new command interpreter using cmd? Why didn't it work without the "cmd /C"?

Also, while this solution worked, I was not able to read (or rather there was nothing displayed) the command line outputs using .stdout.readline. How do i capture the dump messages printed out by the svnadmin dump command (i.e. * Dumped revision 100. * Dumped revision 101. etc)

Thanks, Dexton

Dexton