Choice - Page 2
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18

Thread: Choice

  1. #16
    Join Date
    Feb 2000
    Location
    26.03°N 80.14°W
    Posts
    9,410
    You're Welcome!

    Vernon Frazee, Microsoft MVP (Windows - Shell/User)

    Defenses Up!
    Tip: When prompted for a password, give an incorrect one first. A phishing site will accept it; a legitimate one won't.


    Inside Spyware: A Guide to Finding, Removing and Preventing Online Pests


    If you don't keep up with security fixes, your computer|network won't be yours for long.

  2. #17
    Nix's Avatar
    Nix is offline Aka: Nix*, NNiixx, Nix23
    Join Date
    May 2001
    Location
    Sydney, Australia
    Posts
    8,255
    Interesting thread.

    However, from my reading the assumption is that there is a CD in the drive.

    If there's not won't you get some sortof error message about "failure reading device, Abort, Retry, Ignore" or something to that effect.

    Is it possible to prevent this from happening ?

    I've played around with .bat files trying to determine if a CD is present and if not display a warning message requesting the CD be inserted, but have had no success.

    I'm sure Vernon will come to the rescue.

  3. #18
    Join Date
    Feb 2000
    Location
    26.03°N 80.14°W
    Posts
    9,410
    You might try something like this:
    Code:
    @echo off
     set CD=F:
    :Begin
     cls
     ctty nul
     command /f /c vol %CD%|find " is "
     ctty con
     if errorlevel 1 goto Fail
     echo *** Success reading drive %CD% ***
     vol %CD%
     echo.
     goto End
    :Fail
     cls
     echo.
     echo *** Error reading drive %CD% ***
     echo.
     echo Your two options are:
     echo.
     echo 1) Insert a data CD in drive %CD%
     echo.
     echo or
     echo.
     echo 2) Quit trying and exit to DOS
     echo.
     choice /c:12 /n "Which do you prefer? ([1]/[2]): "
     echo.
     if errorlevel 2 goto End
     goto Begin
    :End
    Notes:
    • Be sure and change that "F:" on the second line to the drive letter of your CD-ROM drive.
    • CHOICE.COM and FIND.EXE must both be somewhere in your PATH.
    Vernon Frazee, Microsoft MVP (Windows - Shell/User)

    Defenses Up!
    Tip: When prompted for a password, give an incorrect one first. A phishing site will accept it; a legitimate one won't.


    Inside Spyware: A Guide to Finding, Removing and Preventing Online Pests


    If you don't keep up with security fixes, your computer|network won't be yours for long.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •