Results 1 to 6 of 6

Thread: Closing Programs (Resolved)

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2004
    Posts
    8

    Resolved Closing Programs (Resolved)

    I have created some code (with sum help from a few guys on here), to open a specific program, and load a saved file for it. What i now need is some coding to close the program i open after it finishes.
    It runs this program constantly, every 30 seconds, and each time it opens it seperately, as opposed to just re-running the specified file. This is the code im using:

    Shell "C:\Program Files\Ghost Mouse\Gmouse.exe c:\documents and settings\ben\desktop\cargo to can.gms"

    Can any one provide me with some code to close this specific file after it has been created?

    Thanks in advance

    *I looked through the forums for anyone else having this problem, and some bright spark replied to a similar post with:

    Private Sub Command1_Click()
    End
    End Sub

    Im not sure if he was having a joke, () but it wasnt perticularly helpful as all it does is close the VB App.. not the specified file.
    Last edited by bob.11; Nov 9th, 2004 at 02:31 AM.

  2. #2
    Hyperactive Member
    Join Date
    Sep 2000
    Location
    NJ, USA
    Posts
    326
    The question I have is.. how will you determine when the program is finished its work to determine whether or not to close it?
    VB.NET 2005 Express with .Net 2.0
    C# 2010 .Net 4.0

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2004
    Posts
    8
    Because i know exactly how long it runs for...

    All i need is an answer.. not a smart alec remark

  4. #4
    Hyperactive Member
    Join Date
    Sep 2000
    Location
    NJ, USA
    Posts
    326
    Not a smart alec remark, I asked because there is an API call that will launch a program and wait for it to exit. Once it exits it returns execution to your program.

    One of the ShellExecute functions I think it is.
    VB.NET 2005 Express with .Net 2.0
    C# 2010 .Net 4.0

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2004
    Posts
    8
    Sorry... I didnt mean to be rude. I have heard of that, but I went for the simple approach.. lol
    All I need is a line of code to kill a certain application. But it seems its not that simple, as if anything is anymore.

  6. #6
    Software Eng. Megatron's Avatar
    Join Date
    Mar 1999
    Location
    Canada
    Posts
    11,286

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