Skip to content

Instantly share code, notes, and snippets.

@goncons
goncons / SelectFiles.vbs
Last active January 23, 2023 14:00
OpenFileDialog (with multiple selection) using powershell from visual basic script. This technique could be used show any System.Windows.Forms windows or form.
' Select the file(s) on a directory
' Based on: http://stackoverflow.com/questions/23249895/open-file-dialog-in-vbscript-using-powershell/23251874#23251874
' http://stackoverflow.com/questions/216710/call-openfiledialog-from-powershell/216738#216738
' http://stackoverflow.com/questions/12270667/calling-powershell-with-wshshell-exec-method-hangs-the-script/13518118#13518118''
' Note: In Windows XP when a filter is selected all files/folder disapper,
' when a new directory (parent or other) is selected the filter begins to work normally.
Private Function ConvertFromUTF8(sIn)
Dim oIn: Set oIn = CreateObject("ADODB.Stream")