Articles

Solved move only the largest text file for a folder to another

December 20, 2012 at 02:49:58
Specs: Windows 7

sir,

I did get a good reply for my earlier post

but this time
i want a vbscript to move 1 single file which is the largest in size among 100's of *.txt files in a folder to another..

ie..
C:\junk contains..
1.txt
2.txt
3.txt
4.txt
5.txt


where 3.txt being the largest in size among these files should be moved to C:\test..

note:
every time the vbscript is run 1 file the largest among the files should be moved


pl help


thanx in advance..


See More: move only the largest text file for a folder to another

Report •


#1
December 20, 2012 at 05:54:43
✔ Best Answer

Easier in batch:
FOR /F "delims=" %%a IN ('dir/b/os/a-d c:\junk\*.txt') DO SET moveFile=%%a
MOVE "C:\junk\%moveFile%" c:\test

How To Ask Questions The Smart Way


Report •

#2
December 20, 2012 at 06:10:38

Sir tried the batch file and it worked fine..

excellent thanx very much..

have a great weekend..


Report •

Related Solutions


Ask Question