Remove extra character from System Path variable using a batch file -


a previous batch file used had accidental " in 1 of scripts, gets added on not being seen.

i'm unable find answer how remove " path variable. advice?

current path:

%m2_home%\bin;%java_home%\bin;c:\programdata\oracle\java\javapath;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0";c:\program files\puppet labs\puppet\bin 

as you'll see, after powershell\v1.0, there ".

any advice more appreciated. i've been banging head on quite awhile.

assuming have variable path create hold environment variable called %path%, write.

set path=%path:"=%

dos string substitution syntax colon followed substring replace equal sign followed text replace substring with. :"= replace " in %path% variable nothing.

set mypath=f:\cyntrx\deploy\scripts\automated_tasks\reportiftavehiclecode\ echo mypath set path=%mypath:\=% echo path 

in order change windows %path% environment variable instead of "fixing" environment variable batch file use, use setx /m command in batch file. important: change not shown echo command until command prompt closed , restarted.

system variable:

setx path "%path:"=%" /m 

user variable:

setx path "%path:"=%" 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -