Computer Hope

Microsoft => Microsoft DOS => Topic started by: batch boy on February 27, 2009, 11:18:39 AM

Title: Need help deciding to delete or exclude certain file size before move
Post by: batch boy on February 27, 2009, 11:18:39 AM
Here's a batch I managed to make that works, but I'm trying to refine it to not copy over files greater than 30kb. Is it easier to delete files 30kb and below before it executes the move command? Or  to just exclude files 30kb and below from moving to the target directory? I googled set limit but was a little over my head as I'm still a neophyte, so I thought the delete would be easier.
 
Code: [Select]

@FOR /R "C:\Documents and Settings\%username%\Program Files\Stair Docs VOB Files\" %%G IN (*.vob) DO del "%%G"


@md "C:\Documents and Settings\%username%\Desktop\trash"

@FOR /R "C:\Documents and Settings\%username%\Program Files\Stair Docs VOB Files\" %%G IN (*.*) DO move /y "%%G" "C:\Documents and Settings\%username%\Desktop\trash"

After I figure out which route to take, I'll just keep modifying it to exclude certain file extensions from being moved as well.






Thanks for any input


edit0000 I refined it a little to target extensions. I'll keep researching how to delete multiple files of a certain size and below.