Is there an equivalent of 'which' on the Windows command line?

后端 未结 26 2027
悲哀的现实
悲哀的现实 2020-11-22 00:40

As I sometimes have path problems, where one of my own cmd scripts is hidden (shadowed) by another program (earlier on the path), I would like to be able to find the full pa

26条回答
  •  隐瞒了意图╮
    2020-11-22 00:54

    I have a function in my PowerShell profile named 'which'

    function which {
        get-command $args[0]| format-list
    }
    

    Here's what the output looks like:

    PS C:\Users\fez> which python
    
    
    Name            : python.exe
    CommandType     : Application
    Definition      : C:\Python27\python.exe
    Extension       : .exe
    Path            : C:\Python27\python.exe
    FileVersionInfo : File:             C:\Python27\python.exe
                      InternalName:
                      OriginalFilename:
                      FileVersion:
                      FileDescription:
                      Product:
                      ProductVersion:
                      Debug:            False
                      Patched:          False
                      PreRelease:       False
                      PrivateBuild:     False
                      SpecialBuild:     False
                      Language:
    

提交回复
热议问题