I\'m sure this must be possible, but I can\'t find out how to do it.
Any clues?
$startinfo = new-object System.Diagnostics.ProcessStartInfo
$startinfo.FileName = "explorer.exe"
$startinfo.WorkingDirectory = 'D:\foldername'
[System.Diagnostics.Process]::Start($startinfo)
Hope this helps
explorer .
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.
Use any of these:
start .
explorer .
start explorer .
ii .
invoke-item .
You may apply any of these commands in PowerShell.
Just in case you want to open the explorer from the command prompt, the last two commands don't work, and the first three work fine.