如何在Powershell中打开一个文件夹

时间:2022-04-07 06:31:56

How to open a folder in PowerShell? I am not talking on how to start PowerShell in a specific folder.

如何在PowerShell中打开文件夹?我不是在谈论如何在特定文件夹中启动PowerShell。

What I mean is that in the command line of powershell i would like to open a folder e.g: " open document"

我的意思是在powershell的命令行中我想打开一个文件夹,例如:“打开文档”

7 个解决方案

#1


56  

Use the Invoke-Item cmdlet, or its alias: ii.

使用Invoke-Item cmdlet或其别名:ii。

PS> ii c:\windows # open the windows directory in windows explorer
PS> ii c:\book.xls # open book.xls in Excel
PS> ii . # open the current directory in windows explorer

#2


10  

For Powershell and cmd compatible way ( and I think the most common way):

对于Powershell和cmd兼容的方式(我认为最常见的方式):

start .
start c:\

#3


9  

Use Invoke-Item, alias ii:

使用Invoke-Item,别名ii:

ii d:\temp\

#4


7  

To open the current folder within the powershell type:

要在powershell中打开当前文件夹,请执行以下操作:

PS>> explorer.exe $(pwd)

PS >> explorer.exe $(pwd)

#5


5  

you can use the explorer.exe to open the folder:

您可以使用explorer.exe打开该文件夹:

explorer.exe c:\temp\
explorer.exe <YourFolderPathHere>

#6


1  

I don't exactly understand what you want, but I have two possible solutions:

我不完全明白你想要什么,但我有两个可能的解决方案:

explorer .\Documents

or

要么

cd .\Documents

#7


-1  

another variant

另一种变体

 hh c:\

 hh http://*.com/questions/8471106

 hh $env:windir\help\WindowsPowerShellHelp.chm

#1


56  

Use the Invoke-Item cmdlet, or its alias: ii.

使用Invoke-Item cmdlet或其别名:ii。

PS> ii c:\windows # open the windows directory in windows explorer
PS> ii c:\book.xls # open book.xls in Excel
PS> ii . # open the current directory in windows explorer

#2


10  

For Powershell and cmd compatible way ( and I think the most common way):

对于Powershell和cmd兼容的方式(我认为最常见的方式):

start .
start c:\

#3


9  

Use Invoke-Item, alias ii:

使用Invoke-Item,别名ii:

ii d:\temp\

#4


7  

To open the current folder within the powershell type:

要在powershell中打开当前文件夹,请执行以下操作:

PS>> explorer.exe $(pwd)

PS >> explorer.exe $(pwd)

#5


5  

you can use the explorer.exe to open the folder:

您可以使用explorer.exe打开该文件夹:

explorer.exe c:\temp\
explorer.exe <YourFolderPathHere>

#6


1  

I don't exactly understand what you want, but I have two possible solutions:

我不完全明白你想要什么,但我有两个可能的解决方案:

explorer .\Documents

or

要么

cd .\Documents

#7


-1  

another variant

另一种变体

 hh c:\

 hh http://*.com/questions/8471106

 hh $env:windir\help\WindowsPowerShellHelp.chm