home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 67,998 of 68,980   
   R.Wieser to Tom Del Rosso   
   Re: DIR of folders   
   02 Jan 23 11:03:15   
   
   From: address@not.available   
      
   "Tom Del Rosso"  wrote in   
   message news:tou4tp$1n7k3$1@dont-email.me...   
      
   > DIR /S/B/AD C:\Tech\TEMP   
   >   
   > will look only into C:\Tech\TEMP   
      
   Yes.  What you didn't tell is that that folder path actually exists.  And in   
   that case it uses the whole path as the start from which to show all of its   
   subfolders - instead of searching for that particular folder, starting from   
   its parent   
      
   If the last part of the path doesn't exists it uses the parent as the   
   starting point and wil look for that folder.   
      
   And yes, that means that you can't look for subfolders with the same name as   
   the one you are starting with.  Sorry.  (at least, I don't know of any   
   setting.)   
      
   > and since it doesn't contain another TEMP under it like   
   > C:\Tech\TEMP\TEMP   
   >   
   > the output is blank.   
      
   Not quite.  It tries to show you all the subfolders of "C:\Tech\TEMP".  And   
   as there do not seem to be any it (ofcourse) returns nothing.   
      
   > I can think of kludgey ways to get around that, but is there an elegant   
   > way?   
      
   That fully depends on your definition of both "cludgy" and "elegant". :-)   
      
   But yes, I there is.  "for /d %%a in (%1\*) do" will iterate thru all   
   subfolders of the one provided (in %1). You can than compare the result (in   
   %%a) with whatever you want.  A bit of recursion (to search subfolders too)   
   than does the rest.   
      
   Regards,   
   Rudy Wieser   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca