Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Where i am doing mistake in this script?
My basic script quiz game... i am new
problem: i made it myself.. saved it as .bat (made with notepad++) now when i execute it first section comes (:MENU) one. when i press 1 and press enter bang in suddenly closes off!.. sorry for bad english please help!
script:
@echo off
:MENU
echo This is my first game ever
echo press 1 to start
set/p=Command:
if %input%===1 goto :L1
:L1
echo lemon have____Test
echo 1:bitter 2:sweet :****
set/p=Command:
if %input%===1 goto :L2
if %input%===2 goto :FAIL
if %input%===3 goto :FAIL
:L2
echo facebook was made by?
echo 1)m. zukerberg 2)Steve Jobs 3)M.duckerberg
set/p=Command
if %input%===1 goto :WIN
if %input%===2 goto :FAIL
if %input%===3 goto :FAIL
:WIN
echo yay you won press 1 to restart
set/p=Command
if %input%===1 goto :L1
:FAIL
echo lol you failed press 1 to restart
set/p=Command:
if %input%===1 goto :L1
the problem was
this error: goto was unecpected at the time
solution was: if %input%===1 goto :WIN
changed it to if %input% '==' goto :WIN
and it works perfectly now thank you :)
1 Answer
- luca mLv 47 years agoFavorite Answer
if %input%===1 goto :L1 ? why the 3 === ?
it should be if '%input%' == '1' goto :L1 (note the ' )
also :
@ECHO OFF
C:
CD\your_script_directory
CLS
:MENU
hope it helps
checck this template: http://community.spiceworks.com/scripts/show/362-b...