1

I have some problems with setting my user variable PATH, my PATH contains the following line:

%PATH%;"C:\Program Files\K-Lite Codec Pack\Media Player Classic";C:\Program Files\SSH Communications Security\SSH Secure Shell 

but when I run mpc-hc.exe from the command line I receive "mpc-hc.exe" is not recognized as an internal or external command, am I doing something wrong?

3
  • no, assume that I run "system" function on C
    – geek
    Sep 9, 2011 at 12:32
  • You said "when I run mpc-hc.exe from the command line". Make your mind up. Anyway, you don't set environment variables like that from code. From code you use the programmatic interface. Sep 9, 2011 at 12:38
  • also while set path=%path%;... makes sense , to have a permanent variable for path, with %path% in the value, sounds nonsensical, 'cos in theory it'd be recursive, though in practice it wouldn't be, but either way it doesn't sound like what one would want.
    – barlop
    Oct 16, 2011 at 5:32

2 Answers 2

3

Using the PATH command, just add your path(s) after %PATH%, without any quotation marks, dividing distinct items with semicolons:

PATH %PATH%;path1;path2

It doesn't matter whether your paths contain spaces or not, they will be added just as you have typed them.

Also it doesn't matter whether you terminate the list with a semicolon or not.

0

Put it in double qutoes and end with ;

%PATH%;"C:\Program Files\K-Lite Codec Pack\Media Player Classic";"C:\Program Files\SSH Communications Security\SSH Secure Shell";

You must log in to answer this question.