An official Batch Programming blog! To Solve the daily problems with windows and fixing them with little notepad scripts. Unlock the Hidden Secrets of Windows, Learn to crack Software via CMD & Make your own Programming tools. Understand to Manipulate your PC via CMD.

TheBATeam Forum

Notifications
Clear all

[Solved] FolderBrowse  


fuxing
Posts: 2
(@fuxing)
New Member
Joined: 2 months ago

Hallo!

I found the FolderBrowser by Fatih Kodak and would like to use it.
But I do have 1 question: How can I use the result in an variable such as %chosenfolder%?

for example:

...

some batchfile

files\folderbrowse.exe "Please chose a folder:"

 

echo %chosenfolder%> folder.txt
....

 

Thanks in advance!
Jürgen

2 Replies
sintrode
Posts: 13
(@sintrode)
Active Member
Joined: 5 months ago

Like all commands that return a value, you can store the output of the command in a variable by using a for /f loop.

 

for /f "delims=" %%A in ('files\folderbrowse.exe "Please choose a folder"') do set "chosen_folder=%%A"
echo %chosen_folder%
Reply
fuxing
Posts: 2
(@fuxing)
New Member
Joined: 2 months ago

Thank you!!!

Reply
Share:

© 2020 TheBATeam

Our Core Values   /   Terms & Conditions   /   Privacy Policy   /   Why Register?

Theme by Anders Norén