与此问题类似,运行以下代码后,浏览器对话框会显示所有正确的按钮,但缺少通常显示可用文件夹的选择区域:
[void] [Reflection.Assembly]::LoadWithPartialName( 'System.Windows.Forms' ) $d = New-Object Windows.Forms.FolderBrowserDialog $d.ShowDialog( )
Gordon Bell.. 11
我曾经遇到过这个问题,并在MSDN论坛上发现了以下COM解决方法:
$app = new-object -com Shell.Application $folder = $app.BrowseForFolder(0, "Select Folder", 0, "C:\") if ($folder.Self.Path -ne "") {write-host "You selected " $folder.Self.Path}
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.dotnet.framework.windowsforms.controls&tid=3607557a-43b3-40bf-8276-be00526e0520&p=1
我曾经遇到过这个问题,并在MSDN论坛上发现了以下COM解决方法:
$app = new-object -com Shell.Application $folder = $app.BrowseForFolder(0, "Select Folder", 0, "C:\") if ($folder.Self.Path -ne "") {write-host "You selected " $folder.Self.Path}
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.dotnet.framework.windowsforms.controls&tid=3607557a-43b3-40bf-8276-be00526e0520&p=1