Why is no string output with ‘echo %var%’ after using ‘set var = text’ command in cmd? [duplicate] You need to bring closer your text from the equal symbol : set var=text echo %var% text