3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Advanced Batch

Step 5SET Command - More Than Meets The Eye (4/4)

SET Command - More Than Meets The Eye (4/4)
At this point, it may seem that the variables of the SET command is only good for strings, and expressions. Not true. The variables are, in fact, very very flexible, and are not just limited to ECHOs.

Have you tried just typing a variable by itself?

SET Test=Instructables%Test%

What a weird error... it says that the command "Instructables" is not recognized, not that %Test% had no syntax. So that means that DOS treats each variable like it was typed by hand. Well, what if...

SET Test=START cmd.exe%Test%

Awesome! It worked!

DOS treats each variable like it was typed by the user, and runs it accordingly. Here's an interesting code: (Just Copy/Paste; it's a bit tedious.)

@ECHO OffSET Variable1=ECSET Variable2=HSET Variable3=O CSET Variable4=ooSET Variable5=l!ECHO %Variable1%%Variable2%%Variable3%%Variable4%%Variable5%ECHO.%Variable1%%Variable2%%Variable3%%Variable4%%Variable5%Pause

Isn't that neat? Each variable contains two letters of the entire message (except Variable2), and putting the variables in order, each letter adds up, and finishes the entire command of ECHO Cool!

The SET command is one of the more complicated, and powerful commands of the DOS dictionary.
« Previous StepDownload PDFView All StepsNext Step »
2 comments
Jul 19, 2009. 12:11 AMDNR says:
u dont need to type echo agn in the lastbcz it will print COOL ! agn......but i want to knw why only Cool ! second time
Feb 2, 2009. 8:32 AMrobotdrengen says:
I don't understand Step 5...
Mar 3, 2009. 2:12 PMmacweirdo says:
how so?

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
22
Followers
5
Author:Neodudeman