setx command not recognized on Windows10

21k Views Asked by At

I am installing software on a new laptop with (unfortunately) Windows 10 and the setx command is not recognized:

'setx' is not recognized as an internal or external command

I have Googled this, but can't find anything related to setx and Windows-10.

Do I need to do something specific to enable this command on Windows-10?

3

There are 3 best solutions below

0
Plaul On BEST ANSWER

The answer was given by svasa. It is strange but it worked. The strange thing is that it always was defined in my path, but as "%SystemRoot%\system32". Capitalizing system32 solved the problem. But this was an all new laptop, so I assume this wrong setting came from Microsoft?

0
Noumenon On

In my case I had to run my batch file as Administrator or from an Administrator command prompt.

0
John Miller On

In some cases, it might be because you are in powershell or some other terminal, not in the "command prompt" terminal (remember to open it with admin)