This script is used for classroom training, you can modify it as you like for production use.



This script is used to gather information on the status of target machines. It will provide a report of the fragmentation status of the target system but not initiate a defrag. This Script is good for Service Level 0 or prospective clients.



------------------------------------------------------------------------------------------



Script Name: Defrag Analyze
Script Description: This script is used to gather information on the status of target machines. It will provide a report of the fragmentation status of the target system but not initiate a defrag. This Script is good for Service Level 0 or prospective clients.

IF True
THEN
Get Variable
Parameter 1 : 10
Parameter 2 :
Parameter 3 : TempPath
OS Type : 0
Execute Shell Command
Parameter 1 : defrag %systemdrive% -a >> #TempPath#\defrag.txt
Parameter 2 : 1
OS Type : 0
Get Variable
Parameter 1 : 1
Parameter 2 : #TempPath#\defrag.txt
Parameter 3 : defragresult
OS Type : 0
Write Script Log Entry
Parameter 1 : The defrag results are - #defragresult#
OS Type : 0
ELSE




Legacy Forum Name: Defrag Analyze,
Legacy Posted By Username: Charles.spencer@kaseya.com