this is how we get our defragged drive
we create a new variable that is a sql query @FraggedDrive@
the query we use is
select LETTER FROM Drives, defragmentation WHERE Drives.driveID = defragmentation.driveID AND defragmentation.totalFrag > 15 AND drives.Computerid = %computerid% AND Drives.Model not like '%USB%' AND Drives.Model not like '%ssd%' AND Drives.Model not like '%cdrom%' limit 1
So if you get a system that has multiple fragged drives you will get a single fragged drive. The script will execute and defrag a single drive. run defrag @FraggedDrive@ to defrag the drive
on next script run you will get the next fragmented drive, etc....
Jeremy Agnew - Service Manager
The Ignition Group of Technology Companies