I'm trying to solve this challenge where I search for Specificly name folder (League of Legends) that is install directory of the game. So full path to the folder is something like C:\Riot Games\League of Legends.
My goal is to find that install folder Riot Games\League of Legends on any disk partition as I know some people use C, D, E, F or whatever.
I've tried following but cmd window just closes in the end without giving me a result:
Code: Select all
@echo on set "folder=" for %%a in (C D E F) do if not defined folder ( pushd "%%a:\" for /d /r %%b in (Riot*Games\League*of*Legends) do set "folder=%%b" popd ) if defined folder %comspec% /k pushd "%folder%"