In a script I would like to execute a dos command wait till it finishes then perform some other tasks.
Here is what I'm currently doing. The line after the RunCommand is executed before the RunCommand has finished.
var doCmd = DOpus.NewCommand;
var cmd = "c:\\CreateBigfiles.exe c:\\mynewbigfile.dat";
doCmd.RunCommand(cmd);
var mynewFIle = DOpus.FSUtil.GetItem("c:\\mynewbigfile.dat")
This give me an error about the file not being found at the RunCommand line.
var doCmd = DOpus.NewCommand;
var cmd = "@sync: c:\\CreateBigfiles.exe c:\\mynewbigfile.dat";
doCmd.RunCommand(cmd);
var mynewFIle = DOpus.FSUtil.GetItem("c:\\mynewbigfile.dat")
Based on your comment I also tried this. Didn't work though.
var doCmd = DOpus.NewCommand;
var cmd = "@sync:c:\\CreateBigfiles.exe c:\\mynewbigfile.dat";
doCmd.SetModifier("sync");
doCmd.RunCommand(cmd);
var mynewFIle = DOpus.FSUtil.GetItem("c:\\mynewbigfile.dat")
No wait, adding @sync: did work. Need to have a space after it though.
Thanks Jon
var doCmd = DOpus.NewCommand;
var cmd = "@sync: c:\\CreateBigfiles.exe c:\\mynewbigfile.dat";
doCmd.RunCommand(cmd);
var mynewFIle = DOpus.FSUtil.GetItem("c:\\mynewbigfile.dat")