I am trying to set a persistent system variable. This is for a process in which a batch file refers to the variable, and then edits the variable at the end of the process.
I am using setx
with the /M
parameter, however, it continues to create the environment variable under the local user instead of the system.
The command I am specifically running is:
setx FN 101 /M
What am I missing?
I did not launch an elevated CMD. Turns out in order for the /M parameter to work, CMD must be run as an administrator.