Hack Forums
[Shell] Find deepest folder on desktop - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] Find deepest folder on desktop (/showthread.php?tid=5697862)



Find deepest folder on desktop - zask - Aug 18, 2017

This is a trick I found, it will locate the deepest folder on the desktop no mater what directory segment its in.


Code
@echo off
for /d /r "%USERPROFILE%\desktop" %%# in (*) do (cd "%SYSTEMDRIVE%%%~p#")
for /d %%a in (*) do (cd "%%a")
echo %cd%
Pause



* - Hackoo - Aug 18, 2017

Thank you for this trick !


* - zask - Aug 18, 2017

(Aug 18, 2017 03:15 PM)Hackoo Wrote:  Thank you for this trick !

Your welcome