Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: DOS batch file - Display popup message with two choices  (Read 24654 times)

0 Members and 1 Guest are viewing this topic.

ventodibolina

    Topic Starter


    Greenhorn

    • Experience: Beginner
    • OS: Unknown
    DOS batch file - Display popup message with two choices
    « on: May 12, 2012, 08:33:45 AM »
    Using a DOS batch file I'd like to display a popup window in XP and Windows 7 where I display a message and give the user the choice to press one of two buttons - one would stop the DOS batch file, while the other button would allow it to continue. Any hint on what dos batch command/pgm I may use?

    Salmon Trout

    • Guest
    Re: DOS batch file - Display popup message with two choices
    « Reply #1 on: May 12, 2012, 08:54:55 AM »
    Windows command language does not have popup windows with buttons but you can use a batch/Visual Basic Script hybrid to do this.

    Code: [Select]
    @echo off
    echo wscript.quit MsgBox ("Continue?", 4, "Please choose") > yesno.vbs
    wscript //nologo yesno.vbs
    set value=%errorlevel%
    del yesno.vbs
    if "%value%"=="6" echo You clicked yes
    if "%value%"=="7" echo You clicked no

    « Last Edit: May 12, 2012, 09:08:16 AM by Salmon Trout »

    ventodibolina

      Topic Starter


      Greenhorn

      • Experience: Beginner
      • OS: Unknown
      Re: DOS batch file - Display popup message with two choices
      « Reply #2 on: May 12, 2012, 09:13:23 AM »
      This works great! Thanks so much!