If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How does CMD.EXE find certain apps?
I have an question re. application paths: how does the command-line
interpreter locate certain executables? E.g.: I can enter "java -jar someJarFile" on the cmd-line and that happily executes "C:\Program Files\Java\jre1.5.0_07\bin\java.exe". But where does cmd know, where that java.exe sits? "C:\Program Files\Java\jre1.5.0_07\bin" is NOT part of the PATH, there is no environment variable relating to Java (like JAVA_HOME or JDK_HOME or such defined), so where exactly does cmd get that info from? Michael |
Ads |
#2
|
|||
|
|||
How does CMD.EXE find certain apps?
It goes back to the old DOS days.
Your computer, durring boot, reads a path that has been predetermined. Example is the Windows folder or the System and System32 folders. To see your existing path, type Path in a DOS prompt (the CMD.exe) now known as the Command Prompt. Your path will be displayed. Anything in the path, can be executed from any folder, therefore, what you type in the Command Prompt is searched in the existing Path automatically. When some programs get installed, the install program may change your existing path by adding a path to the new folder that was created for the installed programs. If you want to add a specific folder to your path, you can do so too. This is handy for Programmers (my self) because we can create executables and have them execute with in a specific folder. If you need to do that, let me know. "Michael Moser" wrote in message ... I have an question re. application paths: how does the command-line interpreter locate certain executables? E.g.: I can enter "java -jar someJarFile" on the cmd-line and that happily executes "C:\Program Files\Java\jre1.5.0_07\bin\java.exe". But where does cmd know, where that java.exe sits? "C:\Program Files\Java\jre1.5.0_07\bin" is NOT part of the PATH, there is no environment variable relating to Java (like JAVA_HOME or JDK_HOME or such defined), so where exactly does cmd get that info from? Michael |
#3
|
|||
|
|||
How does CMD.EXE find certain apps?
happily executes "C:\Program Files\Java\jre1.5.0_07\bin\java.exe". But
where does cmd know, where that java.exe sits? so where exactly does cmd get that info from? java.exe, which I do not have, probably has a listing in the registry in App Paths. The Path environmental variable and a registry entry, App Paths, control what paths do not have to be typed. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\ CurrentVersion\App Paths\java.exe Value Name: Path Data Type: REG_EXPAND_SZ Value Data: Path to java.exe Windows uses this key to find your application and its DLLs if their locations are not already in the system's path. This is also used for the command prompt, the Run command and others. -- Hope this helps. Let us know. Wes MS-MVP Windows Shell/User In , Michael Moser hunted and pecked: I have an question re. application paths: how does the command-line interpreter locate certain executables? E.g.: I can enter "java -jar someJarFile" on the cmd-line and that happily executes "C:\Program Files\Java\jre1.5.0_07\bin\java.exe". But where does cmd know, where that java.exe sits? "C:\Program Files\Java\jre1.5.0_07\bin" is NOT part of the PATH, there is no environment variable relating to Java (like JAVA_HOME or JDK_HOME or such defined), so where exactly does cmd get that info from? Michael |
#4
|
|||
|
|||
How does CMD.EXE find certain apps?
[Wesley Vogel]s message :
happily executes "C:\Program Files\Java\jre1.5.0_07\bin\java.exe". But where does cmd know, where that java.exe sits? so where exactly does cmd get that info from? java.exe, which I do not have, probably has a listing in the registry in App Paths. Windows uses this key to find your application and its DLLs if their locations are not already in the system's path. This is also used for the command prompt, the Run command and others. Are you sure ? command prompt only reads the path variable and current directory, afaik. Good Luck, Ayush. -- Setup Outlook Express to read MS Newsgroups : http://www.microsoft.com/windows/ie/...ups/howto.mspx |
#5
|
|||
|
|||
How does CMD.EXE find certain apps?
Are you sure ? command prompt only reads the path variable and current
directory, afaik. Let's try an example with a file that every Windows XP machine should have. Open a command prompt, type: start msconfig and hit Enter. Does msconfig.exe open? It does for me. So how does cmd.exe know where msconfig.exe is? msconfig.exe is in C:\WINDOWS\pchealth\helpctr\binaries C:\WINDOWS\pchealth\helpctr\binaries is not in the path. --------------------- Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\start msconfig C:\path PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Sys tem32\Wbem;C:\Program Files\Intel\DMIX C:\ --------------------- This is how. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\ App Paths\MSCONFIG.EXE Value Name: (Default) Data Type: REG_SZ Value Data: C:\WINDOWS\PCHealth\HelpCtr\Binaries\MSConfig.exe -- Hope this helps. Let us know. Wes MS-MVP Windows Shell/User In , Ayush" "ayushmaan.j[aatt]gmail.com "ayushmaan.j[aatt]gmail.com" hunted and pecked: [Wesley Vogel]s message : happily executes "C:\Program Files\Java\jre1.5.0_07\bin\java.exe". But where does cmd know, where that java.exe sits? so where exactly does cmd get that info from? java.exe, which I do not have, probably has a listing in the registry in App Paths. Windows uses this key to find your application and its DLLs if their locations are not already in the system's path. This is also used for the command prompt, the Run command and others. Are you sure ? command prompt only reads the path variable and current directory, afaik. Good Luck, Ayush. -- Setup Outlook Express to read MS Newsgroups : http://www.microsoft.com/windows/ie/...ups/howto.mspx |
#6
|
|||
|
|||
How does CMD.EXE find certain apps?
[Wesley Vogel]s message :
Are you sure ? command prompt only reads the path variable and current directory, afaik. Let's try an example with a file that every Windows XP machine should have. Open a command prompt, type: start msconfig and hit Enter. Does msconfig.exe open? It does for me. But not here. It just says 'msconfig' is not recognized as an internal or external command, .... msconfig works from Run dialog. Good Luck, Ayush. -- XP-Tips [Auto logon for Windows XP] : http://www.microsoft.com/windowsxp/u...autologon.mspx |
#7
|
|||
|
|||
How does CMD.EXE find certain apps?
But not here. It just says
'msconfig' is not recognized as an internal or external command, .... I think that you made an error. The command was... start msconfig Not... msconfig Start searches app paths. All of the following start commands work for me from the command prompt. None of the files are in the path. And all of the files are XP files, no 3rd party files involved. All of the files are listed in App Paths. start HelpCtr HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App Paths\HELPCTR.EXE start iexplore HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App Paths\IEXPLORE.EXE start moviemk HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App Paths\moviemk.exe start mplayer2 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App Paths\mplayer2.exe start msimn HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App Paths\msimn.exe start MSInfo32 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App Paths\msinfo32.exe start wab HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App Paths\wab.exe start wmplayer HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App Paths\wmplayer.exe start WORDPAD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App Paths\WORDPAD.EXE start write (opens Wordpad.exe, similar to regedt32 starting regedit.exe) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App Paths\WRITE.EXE -- Hope this helps. Let us know. Wes MS-MVP Windows Shell/User In , Ayush" "ayushmaan.j[aatt]gmail.com "ayushmaan.j[aatt]gmail.com" hunted and pecked: [Wesley Vogel]s message : Are you sure ? command prompt only reads the path variable and current directory, afaik. Let's try an example with a file that every Windows XP machine should have. Open a command prompt, type: start msconfig and hit Enter. Does msconfig.exe open? It does for me. But not here. It just says 'msconfig' is not recognized as an internal or external command, .... msconfig works from Run dialog. Good Luck, Ayush. -- XP-Tips [Auto logon for Windows XP] : http://www.microsoft.com/windowsxp/u...autologon.mspx |
#8
|
|||
|
|||
How does CMD.EXE find certain apps?
[Wesley Vogel]s message :
But not here. It just says 'msconfig' is not recognized as an internal or external command, .... I think that you made an error. The command was... start msconfig Not... msconfig Start searches app paths. With start, it works fine but I thought you are saying that command prompt(not start) searches app paths key. |
#9
|
|||
|
|||
How does CMD.EXE find certain apps?
Michael,
Files\Java\jre1.5.0_07\bin" is NOT part of the PATH, Are you sure that "jre1.5.0_07" is not added to the Path? Hope you verified by typing PATH in Command Prompt. If it's not there really, then see if a copy of "java.exe" is present in one of these locations: %userprofile% %windir% %windir%\system32 -- Regards, Ramesh Srinivasan, Microsoft MVP [Windows Shell/User] Windows® Troubleshooting http://www.winhelponline.com "Michael Moser" wrote in message ... I have an question re. application paths: how does the command-line interpreter locate certain executables? E.g.: I can enter "java -jar someJarFile" on the cmd-line and that happily executes "C:\Program Files\Java\jre1.5.0_07\bin\java.exe". But where does cmd know, where that java.exe sits? "C:\Program Files\Java\jre1.5.0_07\bin" is NOT part of the PATH, there is no environment variable relating to Java (like JAVA_HOME or JDK_HOME or such defined), so where exactly does cmd get that info from? Michael |
#10
|
|||
|
|||
How does CMD.EXE find certain apps?
That's what I stated at first, and that's what I originally thought, but
then I drifted off into left field. And I was wrong. So how *does* the java -jar someJarFile command work with java.exe located in C:\Program Files\Java\jre1.5.0_07\bin and that not being in the path? -- Hope this helps. Let us know. Wes MS-MVP Windows Shell/User In , Ayush" "ayushmaan.j[aatt]gmail.com "ayushmaan.j[aatt]gmail.com" hunted and pecked: [Wesley Vogel]s message : But not here. It just says 'msconfig' is not recognized as an internal or external command, .... I think that you made an error. The command was... start msconfig Not... msconfig Start searches app paths. With start, it works fine but I thought you are saying that command prompt(not start) searches app paths key. |
#11
|
|||
|
|||
How does CMD.EXE find certain apps?
[Wesley Vogel]s message :
So how *does* the java -jar someJarFile command work with java.exe located in C:\Program Files\Java\jre1.5.0_07\bin and that not being in the path? Because there is java.exe in system32 folder. Good Luck, Ayush. -- XP-Tips [Change the thumbnail picture of a folder] : http://www.microsoft.com/windowsxp/u...folderpic.mspx |
#12
|
|||
|
|||
How does CMD.EXE find certain apps?
Because there is java.exe in system32 folder.
Well, that certainly makes sense. Since I do not have java, I was unable to check that, but it makes me feel like saying, Duh. Thank you, Ayush. -- Hope this helps. Let us know. Wes MS-MVP Windows Shell/User In , Ayush" "ayushmaan.j[aatt]gmail.com "ayushmaan.j[aatt]gmail.com" hunted and pecked: [Wesley Vogel]s message : So how *does* the java -jar someJarFile command work with java.exe located in C:\Program Files\Java\jre1.5.0_07\bin and that not being in the path? Because there is java.exe in system32 folder. Good Luck, Ayush. -- XP-Tips [Change the thumbnail picture of a folder] : http://www.microsoft.com/windowsxp/u...folderpic.mspx |
#13
|
|||
|
|||
How does CMD.EXE find certain apps?
Hi Ramesh,
Even though your post is dated 2 April, I just now saw it. Hmm. -- Hope this helps. Let us know. Wes MS-MVP Windows Shell/User In , Ramesh, MS-MVP hunted and pecked: Michael, Files\Java\jre1.5.0_07\bin" is NOT part of the PATH, Are you sure that "jre1.5.0_07" is not added to the Path? Hope you verified by typing PATH in Command Prompt. If it's not there really, then see if a copy of "java.exe" is present in one of these locations: %userprofile% %windir% %windir%\system32 -- Regards, Ramesh Srinivasan, Microsoft MVP [Windows Shell/User] Windows® Troubleshooting http://www.winhelponline.com "Michael Moser" wrote in message ... I have an question re. application paths: how does the command-line interpreter locate certain executables? E.g.: I can enter "java -jar someJarFile" on the cmd-line and that happily executes "C:\Program Files\Java\jre1.5.0_07\bin\java.exe". But where does cmd know, where that java.exe sits? "C:\Program Files\Java\jre1.5.0_07\bin" is NOT part of the PATH, there is no environment variable relating to Java (like JAVA_HOME or JDK_HOME or such defined), so where exactly does cmd get that info from? Michael |
#14
|
|||
|
|||
How does CMD.EXE find certain apps?
Bingo! Thanks for that description! I had already been puzzled quite a
while re. this capability, but recently cmd always picked up the wrong version and that's why I really had to find out this time. Thanks and cheers, Michael "Wesley Vogel" wrote in message ... happily executes "C:\Program Files\Java\jre1.5.0_07\bin\java.exe". But where does cmd know, where that java.exe sits? so where exactly does cmd get that info from? java.exe, which I do not have, probably has a listing in the registry in App Paths. The Path environmental variable and a registry entry, App Paths, control what paths do not have to be typed. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\ CurrentVersion\App Paths\java.exe Value Name: Path Data Type: REG_EXPAND_SZ Value Data: Path to java.exe Windows uses this key to find your application and its DLLs if their locations are not already in the system's path. This is also used for the command prompt, the Run command and others. -- Hope this helps. Let us know. Wes MS-MVP Windows Shell/User |
#15
|
|||
|
|||
How does CMD.EXE find certain apps?
"Michael Moser" wrote in message
... I have an question re. application paths: how does the command-line interpreter locate certain executables? E.g.: I can enter "java -jar someJarFile" on the cmd-line and that happily executes "C:\Program Files\Java\jre1.5.0_07\bin\java.exe". But where does cmd know, where that java.exe sits? "C:\Program Files\Java\jre1.5.0_07\bin" is NOT part of the PATH, there is no environment variable relating to Java (like JAVA_HOME or JDK_HOME or such defined), so where exactly does cmd get that info from? Michael From the "cmd" line, type in "which java" and it should tell you exactly where windows found the executable for "java". This should work for any program you can run from the "cmd" line, then check your "PATH" variable to see if that path is there. -- --- Star Fleet Admiral Q @ your service! "Google is your Friend" http://www.google.com |
|
Thread Tools | |
Display Modes | |
|
|