Link to home
Start Free TrialLog in
Avatar of deepak singla
deepak singla

asked on

update Path variable through cmd

How to remove the %JAVA_HOME%/bin; from Path  variable using cmd?
SOLUTION
Avatar of John
John
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of deepak singla
deepak singla

ASKER

I am running this command "setx /M PATH "%PATH:C:\Program Files\Java\jdk1.8.0_181\bin\;=%""
Instead, to delete this path, it is adding into path variable

C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft Network Monitor 3\;C:\Windows\CCM;C:\Windows\CCM;C:\Program Files\Java\jdk1.8.0_181\bin;C:\Program Files\Java\jdk1.8.0_181\bin\;C:\Program Files\7-Zip\;C:\Program Files\Java\jdk1.8.0_181\bin
I did some looking about this because it is fairly complicated. You would likely have to write a small program to capture the path in a variable, know the parameter to be deleted, edit it out of the path and restore the path to Windows.

Path variables are benign if not used. What harm is the in leaving the extra parameter?
ASKER CERTIFIED SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial