LabTech Support Forums

Disk Defragmentation

This forum is for discussion of expansion script related issues.

Moderator: jware.connectwise

Disk Defragmentation

Postby saurin.computechcity » Wed Jan 20, 2010 1:23 pm

I ran the disk defrag script on an agent. I found out that it runs only on the C: drive. I want it to run on D: drive (or any other drive) too. Could anyone please let me know.

Thanks.
saurin.computechcity
Newbie
Newbie
 
Posts: 16
Joined: Wed Dec 31, 1969 8:00 pm

Disk Defragmentation

Postby mzydo » Wed Jan 20, 2010 2:09 pm

Go into the script and edit statement 5 in the THEN condition.
mzydo
Sr. Member
Sr. Member
 
Posts: 259
Joined: Wed Dec 31, 1969 8:00 pm

Disk Defragmentation

Postby oltconsulting » Wed Jan 20, 2010 2:59 pm

You can also go to the Drives tab of the computer and right click on the drive to defrag - which also seems to work.
oltconsulting
Full Member
Full Member
 
Posts: 108
Joined: Wed Dec 31, 1969 8:00 pm

Disk Defragmentation

Postby saurin.computechcity » Thu Jan 21, 2010 12:23 pm

In the script @ step 5 it says; leaving the field blank will include all the drives. I did that. Still it defragmented only the C drive...
saurin.computechcity
Newbie
Newbie
 
Posts: 16
Joined: Wed Dec 31, 1969 8:00 pm

Re: Disk Defragmentation

Postby rainshadow » Thu Sep 29, 2011 2:33 pm

We are having a similiar issue. It appears that it is looking at the first drive and skipping the rest. So if C: is good and D: is heavily fragmented, it checks C: and then goes to the Else statement and does not get to the THEN statement line 5.
rainshadow
Newbie
Newbie
 
Posts: 33
Joined: Thu Jun 09, 2011 11:16 am

Re: Disk Defragmentation

Postby jagnew.ignitionmsp » Tue Apr 17, 2012 9:28 am

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

E-Mail: jagnew@ignitionmsp.com
Web: http://www.ignitionmsp.com
jagnew.ignitionmsp
Sr. Member
Sr. Member
 
Posts: 250
Joined: Mon Mar 21, 2011 7:58 am


Return to 29B. Scripts

Who is online

Users browsing this forum: No registered users and 1 guest