How to Open Current Directory in Windows Explorer
Introduction
Having the ability to open current directory in windows explorer is extremely useful. It can save you time and energy by allowing you to quickly open the folder automatically.
In this article, we’ll walk you through how to use PowerShell commands to open current directory in windows explorer.
Solution
Using Invoke-Item Cmdlet
We can use Invoke-Item
cmdlet or its alias ii
to open current directory in windows explorer, then followed by dot (.
) to refer to current directory.
Invoke-Item .
Or
ii .
Using Explorer Command from Windows Command Prompt
Since we can use windows command prompt in PowerShell, we can also use its commands, i.e., explorer
followed by dot (.
) to refer to current directory.
explorer .
Using Start Command from Windows Command Prompt
We can also use start
command from windows command prompt followed by dot (.
) to refer to current directory.
start .
Using Start Explorer Command from Windows Command Prompt
We can also combine start
and explorer
command like start explorer
followed by dot (.
) to refer to current directory.
start explorer .
Using System.Diagnostics.Process namespace from .NET Framework
Since PowerShell can use .NET Framework object, we can use its classess hence the method to achieve the same purpose which is to open current directory in windows explorer.
$path = Get-Location
[System.Diagnostics.Process]::Start("explorer.exe", $path)
Conclusion
Using Windows PowerShell enables use to easily open current directory in windows explorer, just remember we can use powershell cmdlet like Invoke-Item
, windows command like start
, explorer
, start explorer
as well as .NET Framework System.Diagnostics.Process
namespace.