windows - Adding a directory to the system path variable through registry -


i trying add directory path variable in windows. entering command line. (or batch file)

@echo off set value=%path%;%programfiles%\atomscript\ reg add "hkey_local_machine\system\currentcontrolset\control\sessions manager\environment" /v path /t reg_expand_sz /d %value% /f 

and comes message

error: invalid syntax. type "reg add /?" usage. 

what doing wrong?

you have quote %value% (with double-quotes) because expansion has embedded blanks c:\program files, etc.

that be

reg add "hkey_local_machine\system\currentcontrolset\control\sessions manager\environment" /v path /t reg_expand_sz /d "%value%" /f 

you can see actual expansions turning echo on in script:

@echo on 

Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -