Michael
Mon Jul 10 09:19:56 CDT 2006
On Mon, 10 Jul 2006 10:08:52 GMT, "Max Bialystock" wrote in
microsoft.public.scripting.vbscript:
>Is it possible to use vbscript to rename a folder full of jpgs, giving each
>one a new name with its size in kilobytes?
>
>So "sample.jpg" would become "29.jpg" indicating that the file size of
>29.jpg is 20 kb.
And how do you want to deal with files of the same size in KB?
Trivial with the right tool. This one-liner works, using 4NT:
For %fn IN (*.jpg) REN "%fn" %@FILESIZE["%fn",K].jpg
Upper case K will show size in 2**10, lower case k in 10**3. 4NT is a
commercial product. @FILESIZE is documented at
<
http://jpsoft.com/help/f_filesize.htm>.
--
Michael Bednarek
http://mbednarek.com/ "POST NO BILLS"