What I'm trying to do is take a directory listing and put each line of output into an environment variable which I can then run through a for loop. I'd use shift to shift each new directory I want to go to into %1. The goal is to extract a bunch of rar files in different directories without knowing the full path to each .rar file. Basically a mass extract.
Something like the following pseudo code:
@echo off for %%dirname in (dir /a:d /o:gne /b /s) do cd %%dirname rar x *.rar
It gets all of the directories below the current, traverses them, extracts whatever rar file is in that directory (they are all old style rars with the .rar -> .r00 -> .r01 etc extensions), and then moves on to the next directory.



Help

Back to top










