How to remove environment variable

21,972

To clear an environment variable using Setx.exe at a command prompt:

Click Start, point to Programs, and then click Command Prompt. If you want to clear a user environment variable, type the following line

setx <variable> "" 

where is the user environment variable. If you want to clear a system environment variable, type the following line

setx <variable> "" -m 

where is the system environment variable. Close the command prompt. When you use Setx.exe to clear an environment variable value, the environment variable name is not affected.

Share:
21,972

Related videos on Youtube

Dao Minh Thu
Author by

Dao Minh Thu

Updated on September 18, 2022

Comments

  • Dao Minh Thu
    Dao Minh Thu over 1 year

    I am use Windows 10 pro. I try to run other Tomcat instance, but I cannot control config (%CATALINA_HOME%).

    This is systempropertiesadvanced (hasn't CATALINA_HOME variable): enter image description here

    I try to echo by cmd (Administrator role) enter image description here

    I try to echo by cmd: (no return result) enter image description here

    Because I want run Tomcat correctly (other Tomcat instance), I must remove variable CATALINA_HOME, please help me!

    • Mokubai
      Mokubai about 8 years
      If you've cleared to variable yourself then you might want to try rebooting (not shutdown) your computer and see if it gets cleared then.
    • Dao Minh Thu
      Dao Minh Thu about 8 years
      Thank you, yesterday, I did the same your advice, It works. But today, nothing change.
    • DavidPostill
      DavidPostill about 8 years
      Tomcat may be running as a service (on startup), using a batch file which sets %CATALINA_HOME%
    • Dao Minh Thu
      Dao Minh Thu about 8 years
      Thank you. inside file \bin\startup.bat, I add this line: set "CATALINA_HOME=C:\data\dcv\liferay\for deploy\liferay-portal-6.2-ce-ga6\tomcat-7.0.62", it works.
    • DavidPostill
      DavidPostill about 8 years
      @dovy Please read Can I answer my own question?. You might want to convert your comment into an answer ;)
    • Dao Minh Thu
      Dao Minh Thu about 8 years
      This is merely a trick, It doesn't resolve the above question.