PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, August 22, 2022

[FIXED] How to append to Path if not already appended

 August 22, 2022     batch-file, environment-variables, windows     No comments   

Issue

I want to append %MYSQL_HOME%\bin and %CATALINA_HOME%\bin to the Path system environment variable on Windows, but I want to append these only if they are not already appended. How do I do it on the command prompt or in a batch script?


Solution

Here's another solution:

path|find /i "%MYSQL_HOME%\bin"    >nul || set path=%path%;%MYSQL_HOME%\bin
path|find /i "%CATALINA_HOME%\bin" >nul || set path=%path%;%CATALINA_HOME%\bin


Answered By - foxidrive
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing