Echo constants in batch scripts without quotes

02 Feb 2015 . posts . Comments
#Systems Administration #Windows

Somewhat based on this Stack Overflow post, I wanted to simplify the code to echo a constrant string without the quotation marks to the console in a Windows batch script., Here’s the script to output the obligatory, “Hello world!” text

@echo OFF
SET variable="Hello World!"
ECHO %variable:"=%
```With the following output```
Hello World!

Comments:

#### Seb -

Does not work for me .. with < in the variable value !!! Great windows!



Me

Anthony is an Australian software engineer and mathematician. As a UTS MBT graduate, Anthony is the technology co-founder of a property and cycling-tech startup and enjoys teaching and learning coding with the Australian startup scene.