The space before the =
is interpreted as part of the name, and the space after it (as well as the quotation marks) are interpreted as part of the value. So the variable you’ve created can be referenced with %location %
. If that’s not what you want, remove the extra space(s) in the definition.
More Related Contents:
- Why is no string output with ‘echo %var%’ after using ‘set var = text’ command in cmd? [duplicate]
- Command Prompt Separation of text by Character [closed]
- Variables are not behaving as expected
- What are the undocumented features and limitations of the Windows FINDSTR command?
- Example of delayed expansion in batch file
- What are the ERRORLEVEL values set by internal cmd.exe commands?
- Assign command output to variable in batch file
- Can I mask an input text in a bat file?
- Make an environment variable survive ENDLOCAL
- Error: “is not recognized as an internal or external command, operable program or batch file”
- How Should I Set Default Python Version In Windows?
- Logical operators (“and”, “or”) in DOS batch
- Setting a system environment variable from a Windows batch file?
- How to create empty text file from a batch file?
- Adding the current directory to Windows path permanently
- Set a persistent environment variable from cmd.exe
- How can a batch file run a program and set the position and size of the window?
- How to search and replace a string that have an equal-to sign “=” inside
- Arithmetic operations with HH:MM:SS times in batch file
- How do I compare timestamps of files in a batch script?
- Open a URL without using a browser from a batch file
- Does Windows batch support exception handling?
- Batch – Converting variable to uppercase
- Get java version from batch file
- How does “FOR” work in cmd batch file?
- How can I source variables from a .bat file into a PowerShell script?
- Batch file for PuTTY/PSFTP file transfer automation
- Why is escaping exclamation marks not necessary in parameter of `for /F` or `for /R`?
- How do I create a batch file timer to execute / call another batch throughout the day
- How can I move all the files from one folder to another using the command line?