HOWTO · PowerShell
How to Open a Folder Using PowerShell
This tutorial will teach you to open a folder using PowerShell.
On this page
To open a folder in Windows File Explorer from PowerShell, run Invoke-Item -LiteralPath 'C:\Users\Public', replacing the path with the folder you want. Use . to open the current working directory. You can also open a file by passing its path. The options below show equivalent commands and when each is useful.
Opening File Explorer requires Windows, so the folder and file commands below are syntax examples. The runnable snippet prints a command for use in a Windows PowerShell session; it does not launch Explorer.
Use Invoke-Item Cmdlet to Open a Folder Using PowerShell
Invoke-Item performs the default action for a path. For a folder, that action opens it in File Explorer; for a file, Windows opens it with the file’s associated application. Quote paths that contain spaces, and use -LiteralPath so characters such as brackets are treated as part of the name.
For a copyable command, this snippet prints the Invoke-Item form for the sample folder:
Write-Output "Invoke-Item -LiteralPath 'C:\Users\Public'"
Invoke-Item -LiteralPath 'C:\Users\Public'
To open the directory from which the PowerShell session is working, pass .: Invoke-Item -LiteralPath ..
To open a file, give its full path. Replace Invoke-Item -LiteralPath 'C:\Users\Public\Documents\example.txt' with the path to an existing file on your computer.
The short alias ii runs the same cmdlet, so ii -LiteralPath 'C:\Users\Public' opens that folder too. Prefer Invoke-Item in scripts when clarity matters; ii is convenient for interactive use.
Use Start-Process (Alias start) to Open a Folder Using PowerShell
Start-Process starts the application associated with a path. Its PowerShell alias is start; this alias is not the same command as Command Prompt’s start built-in. Use a quoted path when it contains spaces.
Use Start-Process -FilePath 'C:\Users\Public' for a chosen folder, or Start-Process -FilePath . for the current working directory.
You can use start -FilePath 'C:\Users\Public' interactively as the alias form. These commands request that Windows open the folder; they do not change PowerShell’s current directory.
Use the explorer Command to Open a Folder Using PowerShell
Call explorer when you specifically want Windows File Explorer. Supply a folder path or . for the current working directory:
Use explorer 'C:\Users\Public' for a chosen folder or explorer . for the current working directory.
Use quotes around paths containing spaces. This starts File Explorer at the selected location while leaving the PowerShell session in its existing directory.
Use cmd.exe With the start Command to Open a Folder Using PowerShell
You can invoke Command Prompt’s start command through cmd.exe. The /c option tells cmd.exe to run the command and then exit. The empty quoted string after start supplies its window-title argument; the following quoted path is the folder to open.
For example, cmd.exe /c start "" "C:\Users\Public" opens the sample folder through Command Prompt’s start command.
This option is useful when you need Command Prompt’s start syntax from a PowerShell session. Quote the folder path so spaces remain part of one argument.
Conclusion
Use Invoke-Item for the default action on a folder or file, Start-Process to start its associated application, or explorer to open a location specifically in File Explorer. Each accepts . for the current working directory. Replace the sample paths with locations that exist on your Windows computer.