CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2000
    Location
    Cedar Rapids, Iowa, USA
    Posts
    57

    Running a MS-DOS batch file in hide mode

    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.


  2. #2
    Join Date
    Feb 2000
    Location
    Indiana
    Posts
    308

    Re: Running a MS-DOS batch file in hide mode

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured