redfive19 Posted June 6, 2008 Share Posted June 6, 2008 Hi guys, I know that Robocopy and Xcopy can recursively search for file masks (*.jpg) and copy them to another folder but they keep the directory structure. Is there any script that anyone knows of that does this with just copying the files to one folder sans folder structure? Example: All .jpg's from C:\folderswithpics\folder1 to c:\pictures Thanks!!! -redfive Link to comment Share on other sites More sharing options...
Airwolf Posted June 6, 2008 Share Posted June 6, 2008 Hi guys,I know that Robocopy and Xcopy can recursively search for file masks (*.jpg) and copy them to another folder but they keep the directory structure. Is there any script that anyone knows of that does this with just copying the files to one folder sans folder structure? Example: All .jpg's from C:\folderswithpics\folder1 to c:\pictures Thanks!!!-redfiveYou can do this in AutoIt with _FileListToArray() or FileFindFirstFile()/FileFindNextFile(), and FileCopy(). VenusProject2 1 Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt Link to comment Share on other sites More sharing options...
Michel Claveau Posted June 6, 2008 Share Posted June 6, 2008 Hi! You can do a little batch, like this: FOR /F "tokens=*" %%i in ('dir C:\sourceroot /AD /s /b') DO XCOPY "%%i\*.jpg" C:\destdoss /Y Where: source-root-folder is C:\sourceroot destination folder is C:\destdoss pattern files is *.jpg If you use the command directly (without Batch), replace all %% by % . Link to comment Share on other sites More sharing options...
Zedna Posted June 6, 2008 Share Posted June 6, 2008 You can use also SHFileOperation API for that.See this post: http://www.autoitscript.com/forum/index.ph...st&p=527285 But what to do in case of the same file names in subfolders? Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now