| 1. |
Solve : DOS BatchFile for deleting file by size in many sub directories? |
|
Answer» I need help on this batch file... DIR %%F >> To_Zap.txtand/or Quote ECHO %%F >> To_Zap.txtThat will give a file, To_Zap.txt, which you can scrutinise at your leisure to decide if the potential victims should be subjected to DEL, or if there are further mistakes to be corrected before you need to reinstall WINDOWS ! ! I will not address the mechanisms for recursion through the sub-directories, I can safely leave that to others. My priority is to warn/guide you so that you do not destroy vital files. Regards Alan Thanks Alan and thanks ...0g74 I am using windows xp and sometimes work with the dos command prompt. So, ..0g74's UNIX like codes cannot be used I think? Alan, thanks for the advise, I know exactly what is this SubMain directory. They are data files specially created to test the code. The 's' was a mistake, in my code ran it was not there. I adjust the code with /S switch. But I could not get any good result to my question. It ask before deleting entire MaAbey directory 'are you sure, confirm, Y/N'. I NEVER wanted to delete entire directory. for %%F IN (C:\MaAbey\*.* /s) DO (if %%~zF LSS 100 DEL %F) pause pause Quote from: mabeykoon on June 15, 2009, 02:38:51 PM I am using windows xp and sometimes work with the dos command prompt. So, ..0g74's UNIX like codes cannot be used I think?no you are wrong. The better and more useful find command in Unix has been ported to windows through GNU. |
|