Reading a registry value to a batch variable, handling spaces in value

后端 未结 2 879
無奈伤痛
無奈伤痛 2021-02-05 15:51

I\'m struggling to read the value of a registry key into a variable. The registry value may, or may not, contain spaces. In this case I\'m trying to look up SDK paths.

I

2条回答
  •  梦毁少年i
    2021-02-05 16:18

    Use Quotation marks

    SET "sdkpath=%%M"

    instead SET sdkpath=%%M

    This will avoid problems with spaces.

提交回复
热议问题