I found this code online, and it allows me to choose a folder using a GUI. Can someone please explain to me how this works, and how I can get an output from it. I am hoping I can get an output and assign that to a variable.
NOTE: I did NOT make this. I simply found it online at another stack overflow post.
:: fchooser.bat
:: launches a folder chooser and outputs choice to the console
:: http://stackoverflow.com/a/15885133/1683264
@echo off
setlocal
set "psCommand="(new-object -COM 'Shell.Application')^
.BrowseForFolder(0,'Please choose a folder.',0,0).self.path""
for /f "usebackq delims=" %%I in (`powershell %psCommand%`) do set "folder=%%I"
setlocal enabledelayedexpansion
echo You chose !folder!
endlocal
Thanks a lot, ChapelCone56