I have a batch script that I occasionally run to clean out my system. Occasionally, bleachbit gets installed into "program files" or I have it run from a portable location (c:\Apps). Code: set bleach1=C:\Apps\bleachbit\bleachbit_console.exe set bleach2="C:\Program Files (x86)\BleachBit\bleachbit_console.exe" if exist %bleach1% set bleach=%bleach1% if exist %bleach2% set bleach=%bleach2% %bleach% --no-uac -c -o --preset
I ended up writing it as follows: Code: set b_flder=bleachbit\bleachbit_console.exe if exist C:\Apps\%b_flder% (set bleach=C:\Apps\%b_flder% else (set bleach="C:\Program Files (x86)\%b_flder%") %bleach% --no-uac -c -o --preset
this is the example. write in console where bleachbit_console anyway more example here https://ss64.com/nt/where.html
where only searches the current path and locations in the PATH variable, which doesn't include the OP's locations by default, and one can not always rely on installers to effectively add things to the PATH variable due to its default length limit.