digitalgerrit
Technical User
Hi there,
I call a batch using ShellExecute using the next lines of code:
if ShellExecute(0, nil, PChar('d:\RNH\zd.bat'), nil, nil, SW_NORMAL) <= 32 then
begin
label4.caption := 'error';
end;
When the batch is tested from the command prompt or from windows it does what it should. When I test it from Delphi, the returnvalue is good, when I test for a value of >32 and fill the label4 with OK it does. So it seems to function like this. But:
The batch transforms an .xml file using the msxsl.exe processor and gives back the result in an output file. But using the code above does not generate the outputfile. I think that maybe it is some kind of delay problem: when called from the command prompt or the windows explorer you see the DOS interface flashing for a brief moment, and 2 or 3 seconds later the file appears. From the Delphi code you only see the DOS interface flashing, you don't see no file appearing, so I thought that maybe it's some kind of time-out problem, maybe Delphi takes over control again before the batch process had a chance to generate the output file.
Does anyone have an idea how to resolve this one?
Any help will be greatly appreciated.
Thanks.
I call a batch using ShellExecute using the next lines of code:
if ShellExecute(0, nil, PChar('d:\RNH\zd.bat'), nil, nil, SW_NORMAL) <= 32 then
begin
label4.caption := 'error';
end;
When the batch is tested from the command prompt or from windows it does what it should. When I test it from Delphi, the returnvalue is good, when I test for a value of >32 and fill the label4 with OK it does. So it seems to function like this. But:
The batch transforms an .xml file using the msxsl.exe processor and gives back the result in an output file. But using the code above does not generate the outputfile. I think that maybe it is some kind of delay problem: when called from the command prompt or the windows explorer you see the DOS interface flashing for a brief moment, and 2 or 3 seconds later the file appears. From the Delphi code you only see the DOS interface flashing, you don't see no file appearing, so I thought that maybe it's some kind of time-out problem, maybe Delphi takes over control again before the batch process had a chance to generate the output file.
Does anyone have an idea how to resolve this one?
Any help will be greatly appreciated.
Thanks.