Good one, Scott. Jeff, remember to add a % to each variable if used in a batch file, vs the command line.
* * *ASB* *http://about.me/Andrew.S.Baker* *Harnessing the Advantages of Technology for the SMB market… * On Wed, Jul 20, 2011 at 12:13 PM, Crawford, Scott <[email protected]>wrote: > For /f “tokens=*” %i in (‘dir *WORDS_TO_SEARCH* /s/a/b/ad’) do robocopy > /mir “%i” DESTINATION_PATH**** > > ** ** > > This will search a folder tree for directorys. Change the dir command to > eliminate the /s if you only want to search the root.**** > > ** ** > > *From:* Jeff Bunting [mailto:[email protected]] > *Sent:* Wednesday, July 20, 2011 11:01 AM > > *To:* NT System Admin Issues > *Subject:* file searching and copying**** > > ** ** > > I'm attempting to search for particular words in a directory name (must use > wildcards!), and, if found, copy the the directory tree while maintaining > its structure to another directory.**** > > **** > > Are there any native tools (or reskit like robocopy) that can accomplish > this somewhat easily? **** > > **** > > thanks,**** > > Jeff**** > > > ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ --- To manage subscriptions click here: http://lyris.sunbelt-software.com/read/my_forums/ or send an email to [email protected] with the body: unsubscribe ntsysadmin
