79486836

Date: 2025-03-05 14:50:53
Score: 3.5
Natty:
Report link

@Mohi provided the answer I was looking for with two different options.

for /F "delims=" %%I in ('dir "C:\setup.exe" /A-D-L /B /S 2^>nul') do cd /D "%%~dpI"

As you can see in the picture below, I started in the root of C: Starting Point To Code Above

The command returned output as it searched through all the folders under the starting point (only listing a couple in the below screenshot), then changed to the destination directory at the end: Destination Point To Code Above

for /F "delims=" %%I in ('dir "C:\Program Files (x86)\Microsoft\Edge\Application\setup.exe" /A-D-L /B /S 2^>nul') do cd /D "%%~dpI"

This is the command that fit my needs perfectly (Thank you @Mohi): Starting Point To Code Above

This command does not return any output as it searches through the directories, and changes to the destination when complete: Destination Point To Code Above

Thank you again to @Mohi for the suggestion and code.

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Probably link only (1):
  • Long answer (-0.5):
  • No code block (0.5):
  • User mentioned (1): @Mohi
  • User mentioned (0): @Mohi
  • User mentioned (0): @Mohi
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Charles Waters