Reputation: 33
On an online tutorial on webservers, the guy(on a MAC) opened a folder which was on his desktop by typing **>> cd folder-2
open .** how do I do the same(equivalent to double clicking on the folder) using Powershell?
Upvotes: 2
Views: 12826
Reputation: 10754
There are three ways that immediately come to mind:
start $folder
, where $folder is the path of the folder to open - it can be either a fully qualified pathname (e.g., C:\Users\Me\Documents\Letters
) or a relative pathname (e.g., Letters
)
Invoke-Item $folder
, where $folder is the path of the folder to open, as above. By default, Invoke-Item
has an alias, ii
.
explorer $folder
, where $folder is the path of the folder to open, as above.
Method 1 also works in cmd.exe
. Both method 1 and method 2 can also take a file name instead of a folder pathname, and will cause the default action for the item to occur - for example, Invoke-Item notes.txt
or start notes.txt
will open notes.txt in notepad (or your system default text editor).
Upvotes: 5
Reputation: 73
In cmd powershell type:
explorer.exe $path
where $path is the name of folder with full path
Upvotes: 0