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

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

Any clues?


Solution 1:

Use:

ii .

which is short for

Invoke-Item .

It is one of the most common things I type at the PowerShell command line.

Solution 2:

You have a few options:

  • Powershell looks for executables in your path, just as cmd.exe does. So you can just type explorer on the powershell prompt. Using this method, you can also pass cmd-line arguments (see http://support.microsoft.com/kb/314853)
  • The Invoke-Item cmdlet provides a way to run an executable file or to open a file (or set of files) from within Windows PowerShell. Alias: ii
  • use system.diagnostics.process

Examples:

PS C:\> explorer
PS C:\> explorer .
PS C:\> explorer /n
PS C:\> Invoke-Item c:\path\
PS C:\> ii c:\path\
PS C:\> Invoke-Item c:\windows\explorer.exe
PS C:\> ii c:\windows\explorer.exe
PS C:\> [diagnostics.process]::start("explorer.exe")

Solution 3:

Use any of these:

  1. start .
  2. explorer .
  3. start explorer .
  4. ii .
  5. 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.

Solution 4:

Just use the Invoke-Item cmdlet. For example, if you want to open a explorer window on the current directory you can do:

Invoke-Item .