set / setlocal / endlocal
Display, create, or change environment variables; localize changes to a batch file’s scope.
set name=value
setlocal begin local scope · endlocal end it
Practice line — try it from memory, then reveal
set city=Boston
Try it safely
Run set city=Boston in the practice shell →
Chapter 13: Runes of the Realm. A sandboxed Command Prompt; nothing touches your PC.