Computing.Net > Forums > Programming > DOS batch to move files of certain size

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

DOS batch to move files of certain size

Reply to Message Icon

Name: artcaz
Date: October 26, 2009 at 09:29:08 Pacific
OS: Windows XP
Product: Microsoft Upg-vc msdos 6.22
Subcategory: Batch
Comment:

I'm new to DOS batch files but help to do the following:

find any files under a certain size in a directory and move them to another directory..



Sponsored Link
Ads by Google

Response Number 1
Name: klint
Date: October 26, 2009 at 11:42:17 Pacific
Reply:

@echo off
setlocal
set /p directory=Directory where the files are: 
set /p size=Critical size in bytes: 
set /p newdirectory=Where to put the smaller files: 
for %%f in ("%directory%\*") do if %%~zf lss %size% move "%%f" "%newdirectory%\"


0
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: DOS batch to move files of certain size

Batch to move without structure www.computing.net/answers/programming/batch-to-move-without-structure/18168.html

Batch to move files www.computing.net/answers/programming/batch-to-move-files/15936.html

Dos Batch to compare file times www.computing.net/answers/programming/dos-batch-to-compare-file-times/17476.html