Is it possible to open a Windows Explorer window from PowerShell?

后端 未结 10 521
小鲜肉
小鲜肉 2020-12-07 07:21

I\'m sure this must be possible, but I can\'t find out how to do it.

Any clues?

10条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-07 07:46

    I came across this question looking for a way to open an Explorer window from PowerShell and also select a file. I'm adding this answer in case others come across it for the same reason.

    To launch Explorer and select a file, use Invoke-Expression:

    Invoke-Expression "explorer '/select,$filePath'"
    

    There are probably other ways to do this, but this worked for me.

提交回复
热议问题