Summary:  Some users have reported that using a script on 64 bit to defrag clients do not run.  Our agent is currently a 32-bit and KACE is working on a 64-bit version.  Find below a script that will run on both:

Copy/paste the below info into a new script by doing the following: 

  1. Scripting > Scripts > Choose Action > Import from XML
  1. Paste below info in
  1. Save script

 

 

<?xml version="1.0" encoding="utf-8" ?>

<kbots xmlns="http://kace.com/Kbots.xsd">

<kbot>

 

<config name="CUSTOM - Defragment the C: drive" type="policy" id="114" version="1327423077" description="Script to defragment the c: ">

 

  <execute disconnected="true" logged_off="true">

  </execute>

 

</config>

 

<compliance>

 

  <verify on_failure="break" attempts="1">

 

    <directory_exists path="&quot;C:\Program Files (x86)\&quot;" />

 

    <on_verify_success>

      <launch_program path="$(KACE_SYS_DIR)" program="cmd.exe" wait="true" parms="/C start /wait %Windir%\Sysnative\defrag.exe C: -f " />

      <log_message type="status" message="Defrag Issued Successfully." />

    </on_verify_success>

 

    <on_verify_failure>

      <log_message type="output" message="Not 64 bit system" />

 

      <on_remediation_success>

        <launch_program path="$(KACE_SYS_DIR)\" program="cmd.exe" wait="false" parms="/C start /wait %SYSTEMROOT%\system32\defrag C: -f" />

      </on_remediation_success>

 

      <on_remediation_failure>

      </on_remediation_failure>

 

    </on_verify_failure>

 

  </verify>

 

</compliance>

 

</kbot>

</kbots>