Home » Questions » Computers [ Ask a new question ]

Find out which application is running when started from Windows command prompt

Find out which application is running when started from Windows command prompt

Due to the number of directories you can put into your %PATH% environment variable it's very easy to have unintentional conflicts between application names. I swore I've come across this tip before, but I can't locate it anywhere. Is there way way at the command prompt to see the directory where the application is located in? For example, I'm looking for something like the following:

Asked by: Guest | Views: 370
Total answers/comments: 2
Guest [Entry]

"A little heavy, but if you like the command line in windows you owe it to yourself to try Cygwin. Place it's \bin folder on your PATH and you'll have a whole host of great tools, not least which, which tells you exactly which file you'd be executing :)

(And yes, I realise the irony of adding to your PATH to help with having too much there)

edit: This may also be appropriate."
Guest [Entry]

"Here is a simple bath file which will do what you want.

@for %%e in (%PATHEXT%) do @for %%i in (%1%%e) do @if NOT ""%%~$PATH:i""=="""" echo %%~$PATH:i

whereis xcopy - works
whereis xcopy.exe - will not work

Hope it helps (somewhat)

Regards"