/ * Renamence, run the program in the current directory, will rename all files in the current directory to * .sys, press the order, and * generate file rename.cmd run, restore the original name, number from 0 Start, due to the directory. .. Can't be changed, so text * From 2.sys Start names long time sometimes mistakes: <* / # include
INT main (void) {WIN32_FIND_DATA FINDDATA; FILE FINDDATE; file * fp; INT i; char buffer [1024]; i = 0; fp = fopen ("rename.cmd", "w"); getCurrentDirectory (1024, buffer) ; STRCAT (Buffer, "// *"); FindHandle = FindFirstFile (Buffer & Findata); if (FindHandle! = Invalid_Handle_Value) {Printf ("% S / N", Findata.cfileName); Sprintf (Buffer, "Rename% D.SYS / "%S/"/n" ,Finddata.cfileName; FPUTS (Buffer, FP); Sprintf (buffer, "% d.sys", i); rename (Finddata.cfileName, Buffer); i ; while (FindnextFile (Finda, & Finddata) {Printf ("% s / n", finddata.cfileName); sprintf (buffer, "rename% D.sys /"% s / "/ n", i , Finddata.cfileName); FPUTS (Buffer, FP); Sprintf (buffer, "% d.sys", i); rename (Finddata.cfileName, Buffer); i ;} findclose (FindHandle);} return 0;} / / --------------------------------------------------- -------------------