QUOTE (Rajesh 2010 @ Oct 17 2010, 07:37 PM)

u can just mount the image created by my script and then run your script
and chk how many rounds of pass it does
i ran your script multiple time on the ramdrive and it does 11 rounds all the times
Ok, then if it doesn't work for you , and you are not going to help me in understanding what the problem could be, simply ignore it and use another method or whatever pleases you.

Here is how it works here:
CODE
C:\dummy>MyFragmenter.exe test.rnd
MyFragmenter v1.2, 2008 J.C. Kessels
Processing: test.rnd
File already exists.
Fragment list (before):
Extent 1: Lcn=12609446, Vcn=0, NextVcn=250
250 clusters, 1 fragments.
Fragmenting:
Largest gap: 32872974 - 39070076 (6197102 clusters)
Moving 25 clusters from offset=0 to LCN=35971512
Largest gap: 14281595 - 20478696 (6197101 clusters)
Moving 25 clusters from offset=25 to LCN=17380133
Largest gap: 26675848 - 32872949 (6197101 clusters)
Moving 25 clusters from offset=50 to LCN=29774386
Largest gap: 74516737 - 78140152 (3623415 clusters)
Moving 25 clusters from offset=75 to LCN=76328432
Largest gap: 49152688 - 52776102 (3623414 clusters)
Moving 25 clusters from offset=100 to LCN=50964382
Largest gap: 52776127 - 56399541 (3623414 clusters)
Moving 25 clusters from offset=125 to LCN=54587821
Largest gap: 56399566 - 60022980 (3623414 clusters)
Moving 25 clusters from offset=150 to LCN=58211260
Largest gap: 60023005 - 63646419 (3623414 clusters)
Moving 25 clusters from offset=175 to LCN=61834699
Largest gap: 63646420 - 67269834 (3623414 clusters)
Moving 25 clusters from offset=200 to LCN=65458114
Largest gap: 67269859 - 70893273 (3623414 clusters)
Moving 25 clusters from offset=225 to LCN=69081553
Fragment list (after):
Extent 1: Lcn=35971512, Vcn=0, NextVcn=25
Extent 2: Lcn=17380133, Vcn=25, NextVcn=50
Extent 3: Lcn=29774386, Vcn=50, NextVcn=75
Extent 4: Lcn=76328432, Vcn=75, NextVcn=100
Extent 5: Lcn=50964382, Vcn=100, NextVcn=125
Extent 6: Lcn=54587821, Vcn=125, NextVcn=150
Extent 7: Lcn=58211260, Vcn=150, NextVcn=175
Extent 8: Lcn=61834699, Vcn=175, NextVcn=200
Extent 9: Lcn=65458114, Vcn=200, NextVcn=225
Extent 10: Lcn=69081553, Vcn=225, NextVcn=250
250 clusters, 10 fragments.
C:\dummy>testcontig.cmd
Finished, 1 files processed.
frags=3.25
Counter=1
Contig v1.55 - Makes files contiguous
Copyright © 1998-2007 Mark Russinovich
Sysinternals - www.sysinternals.com
Summary:
Number of files processed : 4
Number of files defragmented: 1
Average fragmentation before: 3.25 frags/file
Average fragmentation after : 1 frags/file
frags=1
Counter=2
C:\dummy>
jaclaz