Windows Shell Scripting Help

Discussion in 'Windows Desktop Systems' started by Kush, Dec 6, 2005.

  1. Kush

    Kush High On Life!

    Messages:
    4,590
    Location:
    Montreal, Quebec
    ok guys same thing as linux hehe, i actually figured out a lot of stuff in an hour by trial and error, felt like it would be annoying to ask but how do i use an if not statement properly?

    i want to ask the use a question say

    What is the Space Ship's Name?
    and if the user doesnt enter enterprise in any casing (i used /i)
    then it tells him he is incorrect
    set /P Answer1=1.What is the Space Ship's Name?
    echo ******************************
    if /i %Answer1%==Enterprise echo You Are Correct
    if not /i %Answer1%==Enterprise echo You Are Incorrect <-- cant get this part to work
     
  2. madmatt

    madmatt Bow Down to the King Political User

    Messages:
    13,312
    Location:
    New York
    Why not use "else"?

    And ECHO. inserts a blank line (in case you don't want to use "***..."
     
    Kush likes this.
  3. Kush

    Kush High On Life!

    Messages:
    4,590
    Location:
    Montreal, Quebec
    well it is used as an underlying line in, i also did use echo. to create blank lines, i tried to use else but else isnt recognized, i finished it though thanks for trying to help
     
  4. madmatt

    madmatt Bow Down to the King Political User

    Messages:
    13,312
    Location:
    New York
    Thanks for letting me try. I almost felt important for a moment.
     
  5. Kush

    Kush High On Life!

    Messages:
    4,590
    Location:
    Montreal, Quebec
    i actually got it like an hour or so ago, but saw that no one replyed so i didnt feel like bumping the thread hehe :D thanks for trying though