Skip to content

Instantly share code, notes, and snippets.

@techb
Last active November 3, 2020 00:32
Show Gist options
  • Save techb/3495cddd82004432d176250b0723327b to your computer and use it in GitHub Desktop.
Save techb/3495cddd82004432d176250b0723327b to your computer and use it in GitHub Desktop.
:: https://stackoverflow.com/questions/15885132/file-folder-chooser-dialog-from-a-windows-batch-script
@echo off
set dialog="about:<input type=file id=FILE><script>FILE.click();new ActiveXObject
set dialog=%dialog%('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);
set dialog=%dialog%close();resizeTo(0,0);</script>"
for /f "tokens=* delims=" %%p in ('mshta.exe %dialog%') do set "file=%%p"
echo selected file is : "%file%"
scum-bard.cmd --file %file%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment