1.

Solve : Help me? Need a command here?

Answer»

I have made a bunch of batch files recently and I'm trying to make one for school, its a computers PROJECT. It's simple.
@echo off
cls
title Internet Starter
color 0a
:start
echo Would You Like to Run Internet Explorer?
pause
start iexplore.exe
end

but what i want it to do is ASK would you like to run internet explorer then you type and y if you do and a n if you dont....do you understand?Do some research on the command
SET /P
Something like
Code: [Select]set /P Answer=Would You Like to Run Internet Explorer? Thanks Gary, im really a newb at the bat file THING. Hope this gets me a passing grade depending on which version of windows your using. You may want to look up the 'choice' command.

FBusing set /p , all you have to do after is include an if STATEMENT

@echo off
:begin
set /p a=Would you like to open internet explorer?
if "%a%"=="yes" start iexplore.exe
if "%a%"=="YES" start iexplore.exe
if "%a%"=="y" start iexplore.exe
if "%a%"=="Y" start iexplore.exe
if "%a%"=="no" Goto End
if "%a%"=="NO" Goto End
if "%a%"=="n" Goto End
:End


you dont need to include so many, but typing YES yes or y will = yes and NO no or n will mean no



Discussion

No Comment Found