I may have asked this already ~2 years ago but couldn' find the post. But I wonder if there is now a solution for my problem. I have a function
calling a DOS Batch (doCmd.RunCommand)
the Batch file defines some environment variables
I read the environment variables ( var foo = fs.Resolve("%bar%"); ) and
display the values in a dialog.
Problem is that the dialog pops up before the batch has finished and need somehow a sync
here. Any ideas or recommendations.
Thansk - I know @sync and tried that in various combinations (including tab modifier) but I get always an parser error. Currently I have
function OnClick(data) {
var doCmd = DOpus.NewCommand;
doCmd.RunCommand("d:/use/do_ixiasoftservices.bat");
....
A batch file run like that probably won't affect the env-vars outside of the batch file itself.
Also check that the commands the batch runs are actually synchronous. If you run it from a command prompt, does it return before the things it runs are finished? If so then the issue is with the batch file and what it runs, not with how the batch file is being run.
Hi lxp
Tried WScript.Shell already without succes but thnaks for your example.
So it seems that Leo is right and I have problems in my bathc file (though ir says SUCCESS in a command prompt before my "pause"). Shenanigan seems to be
sc queryex "TextmlServer44" | findstr RUNNING
IF NOT ERRORLEVEL 1 setx -m uwetemp_textmlserver 1
If I remove that and define the envionment variable manually everything is fine.
So I need a totally another way to figure out whether a service is running or not.