Click to See Complete Forum and Search --> : Running a MS-DOS batch file in hide mode


Yamini
February 17th, 2000, 03:24 AM
When I am an MS-DOS batch file with shell command like

dim tId as long
tid=shell("c:\batch1.bat",vbhide) 'tId returns the taskId after successful
'execution of the batch file.

then its getting executed but my problem is as I am running batch
files continuously in Hide mode with Shell command, then after some
time the system execution is getting slower. Then if I press ctrl+alt+delete
I could see somany running applications titled 'winoldap'.

The number of 'winoldap's are equal to the no. of times I run the batch
file in hide mode through Shell command.

Please help me out in this by giving me a solution as to
how to avoid those 'winoldap's getting created and system slow down?

Note: In my batch file I am giving commands to terminate that batch file also.
When I run that batch file in DOS mode its getting automatically terminated
after the specific work been done without hassels.

Kyle Burns
February 17th, 2000, 06:53 AM
You're not going to stop winoldap from running. A couple of options would be to use EnumWindows after all the of the batch files should be complete and to terminate those processes (you would need to keep track of the processes that you started to avoid killing somebody else's "winoldap"). See the TList example in the MSDN library for examples of how this can be done. Another option would be to use Windows scripts instead of batch or to use the Script Control.