Hi:BACKGROUND:
I have a LS agent that calls a batch file.
PROBLEM:
When this batch file is called it calls the agent in the console window rather than an external DOS window.
SOLUTION?
Can you explain this as it is causing problems as I want the agent to wait until the external window looses focus and then continues.
Here is my code for the agent to wait until the batch file cmd screen looses focus:
RunApp:
Sub RunApp (program$)
structure:
start.cb = Len(start)
ret& = CreateProcessA(0&, program$, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
ret& = WaitForSingleObject(proc.hProcess, INFINITE)
ret& = CloseHandle(proc.hProcess)
End Sub
Initilaze:
'Execute java
Print ( " ")
Print(" *********** Date greater - running java extractor. ***************** ")
'Set current directory using UNC path so extractor can be run from clients
Chdrive “c”
Chdir “c:\utils\doti\extractor\src”
’ taskId% = Shell(“extractor.bat”, 1)
Print " ******* Extractor Opened *********"
RunApp(“c:\utils\doti\extractor\src\extractor.bat”)
Print " ******* Extractor Closed *********"
qryediflag.SQL = “DELETE FROM XML_FLAG”
resultediflag.Execute
'Vaildation of xml document is performed from extractor program. Therefore the xml file is not created is not valid.
Print " ********** XML FILE Successfully Generated ******* "
End If
Any ideas would be greatly appreciated.
james