tag:blogger.com,1999:blog-2967583513428529427.post4041789739783025366..comments2018-10-02T08:20:18.948-07:00Comments on Tech FAQs: Batch file to execute MySQL scriptsNrip Nihalanihttp://www.blogger.com/profile/14583405880988890842noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-2967583513428529427.post-2001053645686911852013-03-23T06:33:20.965-07:002013-03-23T06:33:20.965-07:00I found the way to order files based on timestamp....I found the way to order files based on timestamp. dir command can be used to list files. We can use options to order by date and generate the list of files. After some try and errors, I found out that we can use following commands to import sqls based on their dates:<br /><br /><br />@echo off<br />ECHO %USERNAME% started the File Execution Process at %TIME% >status.txt<br /><br />dir *.sql /b /o:d > executeFiles.txt<br /><br />for /f "tokens=*" %%f in ( executeFiles.txt ) do (<br />C:\wamp\bin\mysql\mysql5.5.24\bin\mysql -u root testdcrdx --delimiter=// < %%f >>status.txt<br />pause; <br /><br />)Anonymoushttps://www.blogger.com/profile/11152206666764626801noreply@blogger.com