ERASE c:\lowercasenames.bat cPath = "C:\temp\" ADIR(aFiles,"c:\temp\*.JPG") IF TYPE("aFiles") = "C" FOR nCnt = 1 TO ALEN(aFiles,1) cText = "rename " + cPath + ALLTRIM(aFiles(nCnt,1)) +" " + LOWER(ALLTRIM(aFiles(nCnt,1)))+CHR(10) STRTOFILE(cText,"C:\lowercasenames.bat",.t.) ENDFOR ENDIF IF FILE("c:\lowercasenames.bat") RUN /N7 C:\lowercasenames.bat ENDIFThe batch file looks like:
rename C:\temp\TEJAS1.JPG tejas1.jpg rename C:\temp\TEJAS2.JPG tejas2.jpg rename C:\temp\TEJAS3.JPG tejas3.jpg rename C:\temp\TEJAS4.JPG tejas4.jpg rename C:\temp\TEJAS5.JPG tejas5.jpgWhat you cant see in the bat file listing above is that there is a blank line at the end of the file... from the CHR(10).