Jump to content

Batch Files


funkyjunky
 Share

Recommended Posts

Hey Guys,Firstly I am sorry that this is in the wrong board but i didnt know where to put it! (There isnt a batch files board :) )I guess I put it in Java as the people that read this must be quite clever :)AND i have no idea what programming language its in?Anyway, Im sure all you guys remember batch files.I thought i would make one to scare my brother...

@echo offECHO 1. Learn More...ECHO 2. Go to Internet. (default)ECHO 3. Version.ECHO 4. Quit.CHOICE /C:1234 /N /T:2,5 Please choose a menu option.IF ERRORLEVEL == 4 GOTO QUIT_MENUIF ERRORLEVEL == 3 GOTO VERIF ERRORLEVEL == 2 GOTO RUN_INTIF ERRORLEVEL == 1 GOTO LEARN:LEARNECHO Websense Co. MS-DOS Parental ControlECHO UK EditionECHO To uninstall please contact adminastrator:RUN_INTSTART /MAX iexplore:VERECHO Version 3.12 - Updated on 09/03/07:QUIT_MENUECHO It is now safe to exit this program

But it doesnt work when i open it...I cant tell whats up...al the other batch files i have made have worked perfectly...thanks for your time!Ed x

Link to comment
Share on other sites

lol.I think i answered my own question though.I am using XP (obviosuly...) and i dont one of the commands is recognised in XP.Maybe i should dig up my old Win 95 :)Anyway i still need help!!!Thanks.ed x

Link to comment
Share on other sites

  • 3 weeks later...
IF ERRORLEVEL == 4 GOTO QUIT_MENUIF ERRORLEVEL == 3 GOTO VERIF ERRORLEVEL == 2 GOTO RUN_INTIF ERRORLEVEL == 1 GOTO LEARN

Isn't the equality tester in DOS just "=", not "=="? I'm not sure.

Link to comment
Share on other sites

  • 4 months later...
AND i have no idea what programming language its in?
Batch files use internal DOS commandsLooks like your choice is causing the problems, try using this:CHOICE /c 1234 /m "Please choose a menu option."
Link to comment
Share on other sites

  • 4 years later...

The problem is that xp does not have choice as one of it commands, you have to use the set command with the /p extension. Here's the corrected code @echo offECHO 1. Learn More...ECHO 2. Go to Internet. (default)ECHO 3. Version.ECHO 4. Quit.SET /P PUT_VARIABLE_HERE=IF %PUT_VARIABLE_HERE%==1 GOTO LEARNIF %PUT_VARIABLE_HERE%==2 GOTO RUN_INTIF %PUT_VARIABLE_HERE%==3 GOTO VERif %PUT_VARIABLE_HERE%==4 GOTO QUIT_MENU:LEARNECHO Websense Co. MS-DOS Parental ControlECHO UK EditionECHO To uninstall please contact administrator:RUN_INTSTART /MAX iexplore:VERECHO Version 3.12 - Updated on 09/03/07:QUIT_MENUECHO It is now safe to exit this program

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...