Last active
May 27, 2022 17:34
-
-
Save Malix-Labs/fa79bfafb54ac88c82f937472c5e36df to your computer and use it in GitHub Desktop.
Windows File Browser - COM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setlocal | |
for /f "delims=" %%I in ('powershell -noprofile "iex (${%~f0} | out-string)"') do ( | |
echo You chose %%~I | |
) | |
goto :EOF | |
: end Batch portion / begin PowerShell hybrid chimera #> | |
Add-Type -AssemblyName System.Windows.Forms | |
$f = new-object Windows.Forms.OpenFileDialog | |
$f.InitialDirectory = pwd | |
$f.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*" | |
$f.ShowHelp = $true | |
$f.Multiselect = $true | |
[void]$f.ShowDialog() | |
if ($f.Multiselect) { $f.FileNames } else { $f.FileName } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source