exit the command prompt

Discussion in 'Web Design & Coding' started by Glaanieboy, May 17, 2002.

  1. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    I've got an annoying problem with a batch script. It must first connect to my ISP, and then I starts up Winamp, which automatically connects to Wolf FM (an online radio station). I have set it up like this:

    ---------------------------------------------------------------------
    @echo off
    title Connecting Wanadoo and Wolf FM
    rasdial "(name of ISP with quotes)" username password
    if errorlevel 1 goto uhoh
    if not errorlevel 1 goto WolfFM

    :uhoh
    echo There is an error with the ISP,
    echo try again later.
    echo Now press any key continue working with Windows
    pause >nul
    exit

    :WolfFM
    echo Connected!
    echo now connecting Wolf FM (Winamp)
    C:\progra~1\winamp\winamp.exe D:\music\wolffm.m3u

    echo Connected succesfully to Wolf FM! Enjoy!
    exit
    ---------------------------------------------------------------------

    With that final exit is a problem. It only exits when I exit Winamp.
    Can I set it up so that the script automatically exits, even when Winamp is still running?

    ps. I have heard of Windows Scripting Host. Can I use this? And how?
     
  2. crono_logical

    crono_logical Bird Eater

    Place the word "start " in front of the lines which start programs, such as Winamp, that should fix the problem.
     
  3. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Thank you!