stopping batch files

Discussion in 'Visual Basic ( VB )' started by kumarangopi, Feb 14, 2007.

  1. kumarangopi

    kumarangopi New Member

    Joined:
    Feb 6, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    Using VB Can we stop a batch file which is running?
    Scenario
    c:\vbtest.bat


    contents of vbtest.bat
    start c:\myexample.exe
    dir

    contents of myexample.exe
    ------
    check for username and password
    if password is wrong
    I should stop that vbtest ie dir should not be executed.Any ideas or questions let me know?
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    All you can do is end the batch file but it depends on where it will quit. All you have to do see use the FindWindow API and sent that batch file window the kill signal.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice