Posts

Showing posts with the label windows-7

How to set environment variables with spaces?

How to set environment variables with spaces? I need to set values to a environmental variable using a batch file. I wrote the script for this: @echo off set value="Hello world" setx -M srijani "%srijani%;%value%" It gives the error: ERROR: Invalid syntax. Default option is not allowed more than '2' time(s). Type "SETX /?" for usage. I googled and found that while using white spaces we need to write it inside a double quotes. set value="Hello world" But, that is not working too. Note: I am on Windows 7. what are the values of %srijani% and %value% variables. – npocmaka Dec 18 '15 at 10:35 %srijani% %value% Standard mistake often made is using set variable="value" instead of set "variable=value" . See for example Why is no string output wit...