Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

path problems cont.

Status
Not open for further replies.

skarosi

Programmer
Jan 25, 2004
140
GR
Dear all,
few days ago i posted a question here of how to change the path in dos, inorder to run java app, from any directory, and not only in the java\bin. At the time, it seems to work, but now nothing in dos seems to work ok.
i tried to run IPConfig and i get this error:

'ipconfig' is not recognized as operable program or batch file.

As a matter of fact, i get this for some other commands i use, like ping, or even java.
My settings are:
JAVA_HOME=c:\Where\Java\is\installed
Path = %JAVA_HOME%\bin

i guess that i would prefare to have everything working properly, meaning, java to run on every directory, and all other commands as well, but if that is not possible, that i think it must be, i dont really care for java anymore.
thankk in advance
 
The path environment variable is used by the dos system to find all kinds of commands, not just Java ones. The idea is that you have a series of locations contained in the path separated by semi-colons. One of these will be the system32 directory containing things like ipconfig etc.

Mine is set something like this:-
Code:
path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%JAVA_HOME%\bin

Tim
 
when you set the PATH you must set it to include the previous settings.

So in a new DOS prompt, it is :

set PATH=%PATH%;%JAVA_HOME%\bin

--------------------------------------------------
Free Database Connection Pooling Software
 
.. I assumed that since his DOS is 'dead'-ish, he'd changed his global path to just %JAVA_HOME%\bin. Not a good move.

I should have specified in my reply, Skarosi, that the path I quoted is my global one (more-or-less). (I think I explained how this is set in your previous post).

If you modify the path in a .bat file, or at the command-line, then you would do it like sedj tells you above. Otherwise you would be overwriting the current path setting and lots of stuff will cease to work in that context (in this case, however, your global path setting is safe).

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top