Finding the path of the program that will execute from the command line in Windows

后端 未结 3 1425

Say I have a program X.EXE installed in folder c:\\abcd\\happy\\ on the system. The folder is on the system path. Now suppose there is another program

3条回答
  •  不要未来只要你来
    2021-01-29 23:03

    Use the where command. The first result in the list is the one that will execute.

    C:\> where notepad
    C:\Windows\System32\notepad.exe
    C:\Windows\notepad.exe
    

    According to this blog post, where.exe is included with Windows Server 2003 and later, so this should just work with Vista, Win 7, et al.

    On Linux, the equivalent is the which command, e.g. which ssh.

提交回复
热议问题