So, you are searching a whole tree? Seems like you'd end up with duplicates if the search terms show up at one level and a sublevel. If you're just searching one level, you might try subst to shorten the paths. For instance, if your base is c:\long\path\to\root, you can run subst x: c:\long\path\to\root to trim a bunch off the length.
From: Jeff Bunting [mailto:bunting.j...@gmail.com] Sent: Wednesday, July 20, 2011 1:25 PM To: NT System Admin Issues Subject: Re: file searching and copying Thanks all. Scott's suggestion is close and at least got me pointed in the right direction. Some of the paths are too long for DIR which throws a wrench in the works, so I'm going to have to rely on windows search for now. Powershell, unfortunately, currently isn't an option. Jeff On Wed, Jul 20, 2011 at 12:23 PM, Andrew S. Baker <asbz...@gmail.com<mailto:asbz...@gmail.com>> wrote: 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 <crawfo...@evangel.edu<mailto:crawfo...@evangel.edu>> 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:bunting.j...@gmail.com<mailto:bunting.j...@gmail.com>] 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 listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com> with the body: unsubscribe ntsysadmin ~ 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 listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com> with the body: unsubscribe ntsysadmin ~ 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 listmana...@lyris.sunbeltsoftware.com with the body: unsubscribe ntsysadmin