Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


windows equivalent to "which" command on unix

Posted on 2004-11-02
Medium Priority
Last Modified: 2006-11-17
Is there a windows equivalent command to "which" command on unix.

I am trying to get the full path of the executable that is used, when I just run a exe from cmd prompt.

If there is no command, Is there an solution to achieve that?

Question by:chennarh
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 57

Expert Comment

by:Pete Long
ID: 12475296
confused do you mean

echo %path%

Author Comment

ID: 12475992
Say I have a test.exe in 10 different directories, and all of them are included in my path, and I open up a command prompt and type "test", I want to know which one of those 10 files is being executed.
LVL 85

Accepted Solution

oBdA earned 500 total points
ID: 12476037
Download the GNU utilities for Windows; it contains a "which".
GNU utilities for Win32

A single line in a batch will work as well:

@echo %~$PATH:1

Expert Comment

ID: 12476061
Not sure I understand.  Are you trying to type a command without the full path?  Then hold down the Windows key and press the "F" key.  Find the directory of the .exe, and add it to your path:

1. Right click on my computer, select properties
2. Click on the Advanced Tab
3. Choose Environment Variables.
4. Add to the end of System or User Variables.

I have NO idea if I am answering the right question! :)

Author Comment

ID: 12476329
Thanks oBdA.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Often we come across situations wherein our batch files would be needing to reboot Windows for a variety of reasons. A few of them would be like: (1) Setup files have been updated whose changes can take effect only after a reboot …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question