I'm interfacing with a program that requires the use of the Path environment variable. My program has to modify the contents of this variable based on criteria selected by the user. So that I didn't have to parse/search through the path variable to find the part that I want, I created a new environment varibable named myPath. I add this to the Path variable by like this:

%myPath%.

This works fine but I want to eliminate the initialization setup where the user has to manually modify the path variable. I can create the new variable easily but how would I look to see if %myPath% is already in the path variable and if it isn't add it?