Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 231338

Re: Opening a window to save a file using FolderBrowserDialog

$
0
0

Looks like there is no native Windows dialog that offers that functionality.
There are indeed some that seem to use the SaveFileDialog with a dummy filename, but that is not really an elegant solution.

 

$PickFolder=New-Object-Typename System.Windows.Forms.OpenFileDialog

$PickFolder.FileName='dummy'

$PickFolder.Filter='Folder Selection|*.*'

$PickFolder.AddExtension=$false

$PickFolder.CheckFileExists=$false

$PickFolder.Multiselect=$false

$PickFolder.CheckPathExists=$true

$PickFolder.ShowReadOnly=$false

$PickFolder.ReadOnlyChecked=$true

$PickFolder.ValidateNames=$false


$PickFolder.ShowDialog()


Split-Path$PickFolder.FileName


Viewing all articles
Browse latest Browse all 231338

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>