It's programming time!/Batch/Echo/More
From Create Your Own Story
(Difference between revisions)
(Created page with '==Echo/More== <div style="background-color:rgb(245,245,245);"> There are all kinds of ways you can use '''echo'''. Let's try some cool stuff with it. </div> <div style="padding:…') |
m |
||
Line 31: | Line 31: | ||
*[[It's_programming_time!/Batch/Echo|Let's go back to the basics of "'''echo'''".]] | *[[It's_programming_time!/Batch/Echo|Let's go back to the basics of "'''echo'''".]] | ||
*[[It's_programming_time!/Batch/Type|Why do I need '''type'''. I want to use '''echo''' for everything.]] | *[[It's_programming_time!/Batch/Type|Why do I need '''type'''. I want to use '''echo''' for everything.]] | ||
- | *[[It's_programming_time!/Batch/ | + | *[[It's_programming_time!/Batch/Redirection Operators|What about those '''>''' and '''>>''' operators? Explain.]] |
[[Category:It's programming time!|Batch]] | [[Category:It's programming time!|Batch]] | ||
[[Category:It's programming time!/Batch|Echo]] | [[Category:It's programming time!/Batch|Echo]] |
Revision as of 03:12, 16 July 2016
Echo/More
There are all kinds of ways you can use echo. Let's try some cool stuff with it.
This example outputs some files. Be careful not to overwrite something accidentally.
Run this for help with help:
@echo OFF echo Time for some fun with echo. echo. rem use echo. to add a blank line to the output. echo Where'd this text go^? > "Oh here it is.txt" echo You can store variables using the set command and ^= operator. set myVar=This is a variable. echo. echo And you can display variables using the echo. echo %myVar% echo. pause echo You can also use echo to write to files. echo This stuff is in newFile^.txt >> "newFile.txt" echo You can then use type to read files. type newFile.txt pause