Results 1 to 8 of 8

Thread: Closing a command window [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349

    Closing a command window [RESOLVED]

    Guys,
    I really need help on closing a command window that i have created using the following code:

    VB Code:
    1. Public Function ExecCmd(cmdline$)
    2.     Dim proc As PROCESS_INFORMATION
    3.     Dim start As STARTUPINFO
    4.     Dim ret&
    5.     start.cb = Len(start)
    6.     ret& = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
    7.     ret& = WaitForSingleObject(proc.hProcess, INFINITE)
    8.     ret& = CloseHandle(proc.hProcess)
    9. End Function

    This is the usage of it:
    VB Code:
    1. Call ExecCmd(App.Path & "\rar a " & rarName & ".rar " & "*.*")

    Now the problem is that when i run the code on my XP machine it works perfectly, the window appears and compresses my files and then automatically closes itself. However, when i run it on a Win2K machine, the window appears, but does not close itself, rather i have to close it manually, which i don't want my users to have to do.

    Can anyone tell me why this code doesn't perform on 2K, or if there is a way to check if the window has closed and close it if it hasn't closed?

    Any help with this problem would be greatly appreciated, my boss is practically screaming for this to be finished.
    Last edited by Blinky Bill; Oct 29th, 2002 at 07:48 PM.
    We don't know what's wrong. . . So the best bet might be to remove something surgically.

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