SETX /M and PATH system variable
Posted: 14 Nov 2024 01:43
I would like to add a path (for example c:\test) to *system* variable (not user variable). Press WIN+R and type SystemPropertiesAdvanced and press ENTER. Click on 'environemnt variables'. At the top are user settings and at the bottom systemwide settings. And instead of adding a new path to the system PATH variable I would like to use SETX command. But I get this error:
Open cmd as Administrator:
I don't have a virtual machine to test this so I don't want to corrupt the PATH variable.
Anyone has a solution?
Thanks.
Saso
Open cmd as Administrator:
Code: Select all
C:\WINDOWS\system32>setx path %path%;c:\TEST /m
ERROR: Invalid syntax. Default option is not allowed more than '2' time(s).
Type "SETX /?" for usage.
C:\WINDOWS\system32>
Anyone has a solution?
Thanks.
Saso