Ok, I want to make a script like this:
@echo off
color 1C
echo Welcome to the test
pause
LABEL::
What URL to go to?
start %answer%
pause
how do I do it now? it sdont work!
Offline
TornFusion wrote:
Ok, I want to make a script like this:
@echo off
color 1C
echo Welcome to the test
pause
LABEL::
What URL to go to?
start %answer%
pause
how do I do it now? it sdont work!
Try this (the only time I use caps a lot is with Batch files):
@ECHO OFF COLOR 1C ECHO Welcome to the test ECHO What URL do you want to go to? SET /P ANSWER= START %ANSWER% PAUSE
Last edited by ThePCKid (2011-05-21 10:56:17)
Offline
ThePCKid wrote:
TornFusion wrote:
Ok, I want to make a script like this:
@echo off
color 1C
echo Welcome to the test
pause
LABEL::
What URL to go to?
start %answer%
pause
how do I do it now? it sdont work!Try this (the only time I use caps a lot is with Batch files):
Code:
@ECHO OFF COLOR 1C ECHO Welcome to the test ECHO What URL do you want to go to? SET /P ANSWER START %ANSWER% PAUSE
This doesn't seem to work. It says the syntax is WRONG
Offline
bump. Using windows 7
Offline
TornFusion wrote:
ThePCKid wrote:
TornFusion wrote:
Ok, I want to make a script like this:
@echo off
color 1C
echo Welcome to the test
pause
LABEL::
What URL to go to?
start %answer%
pause
how do I do it now? it sdont work!Try this (the only time I use caps a lot is with Batch files):
Code:
@ECHO OFF COLOR 1C ECHO Welcome to the test ECHO What URL do you want to go to? SET /P ANSWER= START %ANSWER% PAUSEThis doesn't seem to work. It says the syntax is WRONG
Oops! I forgot an equals sign. Try the code now.
Offline
thanks! Now, how can i make it sense if person says y or n
Offline
TornFusion wrote:
thanks! Now, how can i make it sense if person says y or n
Here is something nice: rem denotes a comment.
There are two ways.
1. One command only
2. Multiple commands
ECHO Blah blah blah? [Y/N] SET /P VarName= IF %VarName% == Y rem Command here IF %VarName% == N rem Command here
ECHO Blah blah blah? [Y/N] SET /P VarName= IF %VarName% == Y GOTO YEAH IF %VarName% == N GOTO NOPE :YEAH rem Commands here :NOPE rem Commands here
Last edited by ThePCKid (2011-05-21 12:34:55)
Offline
ThePCKid wrote:
TornFusion wrote:
thanks! Now, how can i make it sense if person says y or n
Here is something nice: :: denotes a comment.
There are two ways.
1. One command only
2. Multiple commandsCode:
ECHO Blah blah blah? [Y/N] SET /P VarName= IF %VarName% == Y ::Command here IF %VarName% == N ::Command hereCode:
ECHO Blah blah blah? [Y/N] SET /P VarName= IF %VarName% == Y GOTO YEAH IF %VarName% == N GOTO NOPE :YEAH ::Commands here :NOPE ::Commands here
WOW! YOU ARE THE BEST SCRATCHER EVER! THANKYOU THANKYOU THANKYOU!
Last edited by TornFusion (2011-05-21 12:45:07)
Offline
TornFusion wrote:
ThePCKid wrote:
TornFusion wrote:
thanks! Now, how can i make it sense if person says y or n
Here is something nice: :: denotes a comment.
There are two ways.
1. One command only
2. Multiple commandsCode:
ECHO Blah blah blah? [Y/N] SET /P VarName= IF %VarName% == Y ::Command here IF %VarName% == N ::Command hereCode:
ECHO Blah blah blah? [Y/N] SET /P VarName= IF %VarName% == Y GOTO YEAH IF %VarName% == N GOTO NOPE :YEAH ::Commands here :NOPE ::Commands hereWOW! YOU ARE THE BEST SCRATCHER EVER! THANKYOU THANKYOU THANKYOU!
You're welcome.
Also, I screwed up. rem denotes comments, :: is glitchier.
Offline
By the way, can you add to a variable, like set a variable to 0, and later on, add 1 to it?
Offline
TornFusion wrote:
ThePCKid wrote:
TornFusion wrote:
thanks! Now, how can i make it sense if person says y or n
Here is something nice: :: denotes a comment.
There are two ways.
1. One command only
2. Multiple commandsCode:
ECHO Blah blah blah? [Y/N] SET /P VarName= IF %VarName% == Y ::Command here IF %VarName% == N ::Command hereCode:
ECHO Blah blah blah? [Y/N] SET /P VarName= IF %VarName% == Y GOTO YEAH IF %VarName% == N GOTO NOPE :YEAH ::Commands here :NOPE ::Commands hereWOW! YOU ARE THE BEST SCRATCHER EVER! THANKYOU THANKYOU THANKYOU!
Even better for muliple commands:
ECHO Blah blah blah? [Y/N] SET /P VarName= IF %VarName% == Y ( rem Command 1 rem Command 2 rem Etc... ) IF %VarName% == N ( rem Command 1 rem Command 2 rem Etc... )
Offline
Now how do you rename files on w7?
Offline
TornFusion wrote:
Now how do you rename files on w7?
REN <old name> <new name> RENAME <old name> <new name>
Both do the same thing.
Last edited by ThePCKid (2011-05-21 13:05:11)
Offline