0

I'm trying to edit an environment variable, but i'm getting an error that

'setx' is not recognized as an internal or external command, operable program or batch file.

I can use the set command, but setx is no-go. I'm on Windows 8.1

Any help is wanted.

2 Answers2

0

I think you're using it wrong. Just typing setx isn't going to cut it, as the command prompt will believe that it is a program. As it doesn't find it, it gives off that error message.

The correct ways to use setx can be seen here, for instance. The main part is that after setx you have to append the name and value of the variable you want to alter, for it to be evaluated as an internal command.

Doktoro Reichard
  • 5,390
  • 5
  • 35
  • 42
  • 2
    actually setx without an argument gives this output: `ERROR: Invalid syntax. Type "SETX /?" for usage.` Your answer seems pretty wrong; you maybe wanna delete it or strikethrough – kluka Jul 18 '15 at 23:05
  • I believe that both myself and the OP might not have setx on our machines or path variables, which explains the OP's error message. Although I used Windows XP when writing the answer (XP does not have setx by default), Windows 8 should have setx. Either the path variable isn't leading to it or setx has been deleted from the system. The fact that the OP hasn't answered in over a year doesn't help as well. – Doktoro Reichard Jul 19 '15 at 12:06
-1

Since Setx is a system tool that usually is located in \Windows\System32 you need to check if the \System32 was removed from PATH in your Environment Variables (see What are PATH and other environment variables, and how can I set or use them?). Normally this shouldn't have happened.

If it is not in there, then add C:\Windows\System32 back to your PATH.

Aravinthan K
  • 101
  • 1
  • 1
    Please explain this answer in more detail—as written, it's not all that easy to understand. – bwDraco Jul 18 '15 at 23:10
  • How does one check if \Windows\System32 is in the PATH environment variable? – Mogget Jul 20 '15 at 05:23
  • @Mogget in cmd, run `set path` and it should show the path variable. Otherwise, go to My Computer -> Advanced system settings -> Advanced tab -> Environment Variables. – Doktoro Reichard Jul 20 '15 at 15:40