move files bigger tan 4 gb to another folder

March 2, 2010 at 04:40:36
Specs: Windows 7
Guys

hope you can help?

How can I move files with say a .avi extension bigger than 4gb to a folder?

I want to make use of dos (windows 7 65 bit)

thank you
Theo


See More: move files bigger tan 4 gb to another folder

Report •


#1
March 2, 2010 at 19:07:09
here's something to start with (use "avifiles" for your avi directory, whatever it is)

pushd c:\avifiles
md .\bigfiles
for %%a in (*.avi) do if %%~za gtr 4000000000 move %%a .\bigfiles
---------------- end
(not tested)


Report •

#2
March 2, 2010 at 20:50:28
nbrane: 4GB is actually 4 * 2^30 (or 4,294,967,296) bytes. Don't let the HDD manufactures' lies deceive you.

Report •

#3
March 2, 2010 at 20:57:41
ya, i tend to forget the binary adjust, esp now that the numbers have got so huge. 1024=1k etc.
294 million is not a thing to disregard, considering humans haven't even been around over about 3 million years + or -.
(on other hand, 294 million atoms don't take up a lot of room)

Report •

Related Solutions

#4
March 3, 2010 at 01:24:23
thanks nbrane

If i want to move files in the subfolder as well? Move the folder with the file? Will that be possible using this command?

thanks


Report •

#5
March 3, 2010 at 12:43:23
I guess you need to have a look here :

FOR /R [[drive:]path] %variable IN (set) DO command [command-parameters]

Walks the directory tree rooted at [drive:]path, executing the FOR
statement in each directory of the tree. If no directory
specification is specified after /R then the current directory is
assumed. If set is just a single period (.) character then it
will just enumerate the directory tree.


Report •

#6
March 3, 2010 at 18:35:18
yeah, to incoporate Tvc's code (and Razor's reality check):

pushd c:\avifiles
md .\bigfiles
for /r %%a in (*.avi) do if %%~za gtr 4294967296 move %%a \avifiles\bigfiles
---------------- end
(i'm pretty sure you need to modify the target to be specific, like \avifiles\bigfiles instead of relative like .\bigfiles.)


Report •


Ask Question