Occasionally you require a list of each and every one of the files and/or folders within a directory among their full path, exclusive of whichever further information. “DIR /B” would be the correct command, if it simply written out the full path (it does that simply if united through the recursion parameter /S). Here is a method to get a listing of full paths, in the next instance of all folders inside the directory “C:\Users”:
Code:
D:\>for /f "delims=" %i in ('dir /b /ad "C:\Users"') do @echo C:\Users\%i
C:\Users\All Users
C:\Users\Default
C:\Users\Public
...
If you would like files scheduled, put back “/ad” by “/a-d”. If you would like together files and folders, make use of “/a”.
Bookmarks