I am carrying out a series of repetitive processes on several computers that I think could be solved by preparing a small batch.
The fact is that searching the internet I found the following:
setx TEST "C:\"
Which would create a USER variable called test with value "C:\".
I see that if SET is used, the variable is created for system but it is temporary, as soon as the computer is restarted or the cmd window is closed, it is lost, and it is not useful to me either.
The fact is that the variables that I need to generate are SYSTEM variables, not USER variables, since the application that will later use these variables can be used by several users on the same computer.
So, does anyone have any idea how I can record these system variables in a simple way, call it batch or call it any other system.
setx can be called with the argument
/m
. According to the documentation:So doing
setx /m TEST "C:\"
a system variable with key "TEST" and value "C:\" would be established