Kaseya Community

CCleaner /auto runs doesn't clean

  • So I've scripted CCleaner to run silently but there seems to be a problem. It runs but doesn't seems to remove anything. I'm using the /auto switch but I'm not seeing anything being removed. I checked one PC before and after running the script and the results are the same. Am I missing something? Thanks.

  • Are you copying the "ccleaner.ini" file to the target computer as well as the executable?

  • What user are you running CCleaner with in the script? Is it the same user you're testing with?

    Running as SYSTEM will clean out the profile for Local System and not the currently logged in user.

  • Ahhh, of course. Good suggestion, SMason!

  • Thanks everyone for the input.. very helpful. It appears the problem was the missing ini file. It works beautifully now.

  • I just run CCleaner when a user is logged on.

  • Im having some issues with Ccleaner not sure my script is right does any one have one that works that would like to share there script?

  • Here's a simple one:

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

    <ScriptExport xmlns:xsi="www.w3.org/.../XMLSchema-instance" xmlns:xsd="www.w3.org/.../XMLSchema" xmlns="www.kaseya.com/.../Scripting">

     <Procedure name="CCleaner" treePres="3" id="610710968" folderId="21246231921621776498221953">

       <Body description="Downloads the ccleaner executable and the .ini file, runs the cleanup then exits. This should work on all Operating systems, including Windows 2008 x64&#xD;&#xA;">

         <If description="Downloads the ccleaner executable and the .ini file, runs the cleanup then exits. This should work on all Operating systems, including Windows 2008 x64&#xD;&#xA;">

           <Condition name="UserIsLoggedIn">

             <Parameter xsi:type="StringParameter" name="UserName" value="" />

           </Condition>

           <Then>

             <Statement description="" name="WriteDirectory" continueOnFail="false">

               <Parameter xsi:type="StringParameter" name="Path" value="#vAgentConfiguration.agentTempDir#\DiskClean" />

               <Parameter xsi:type="StringParameter" name="SourceDirectory" value="VSASharedFiles\ccleaner\" />

             </Statement>

             <Statement description="" name="ExecuteFile" continueOnFail="false">

               <Parameter xsi:type="StringParameter" name="Path" value="#vAgentConfiguration.agentTempDir#\DiskClean\CCleaner.exe" />

               <Parameter xsi:type="StringParameter" name="Arguments" value="/auto" />

               <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="User" />

               <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="True" />

             </Statement>

             <Statement description="" name="PauseScript" continueOnFail="false">

               <Parameter xsi:type="IntegerParameter" name="Seconds" value="300" />

             </Statement>

             <Statement description="" name="DeleteFile" continueOnFail="false">

               <Parameter xsi:type="StringParameter" name="Path" value="#vAgentConfiguration.agentTempDir#\DiskClean\CCleaner.exe" />

             </Statement>

             <Statement description="" name="DeleteFile" continueOnFail="false">

               <Parameter xsi:type="StringParameter" name="Path" value="#vAgentConfiguration.agentTempDir#\DiskClean\CCleaner.ini" />

             </Statement>

             <Statement description="Write an Entry into the Procedure Log" name="WriteScriptLogEntry" continueOnFail="true">

               <Parameter xsi:type="StringParameter" name="Comment" value="CClean completed successfully" />

             </Statement>

           </Then>

           <Else>

             <Statement description="" name="WriteScriptLogEntry" continueOnFail="false">

               <Parameter xsi:type="StringParameter" name="Comment" value="CClean failed. User not logged in." />

             </Statement>

           </Else>

         </If>

       </Body>

     </Procedure>

    </ScriptExport>

  • How do i import this?

  • CCleaner is the best utility program used to clean potentially unwanted files and invalid Windows Registry entries from a computer.

  • Go to Agent Procedures - Import Procedure and copy paste the code into the procedure and import...

  • If you click the option "Use rich formatting" when you make your post, there is a tab at the top that you can select to upload the XML file. That's the best way to post a script in the forum

  • Trying to paste in my first script from the forum is not working for me, can anyone tell me if I'm in the right spot or copied wrong?
    Thank you


  • Try this...

     

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

    <ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting">

      <Procedure name="CCleaner" treePres="3" id="610710968" folderId="21246231921621776498221953">

        <Body description="Downloads the ccleaner executable and the .ini file, runs the cleanup then exits. This should work on all Operating systems, including Windows 2008 x64&#xD;&#xA;">

          <If description="Downloads the ccleaner executable and the .ini file, runs the cleanup then exits. This should work on all Operating systems, including Windows 2008 x64&#xD;&#xA;">

            <Condition name="UserIsLoggedIn">

              <Parameter xsi:type="StringParameter" name="UserName" value="" />

            </Condition>

            <Then>

              <Statement description="" name="WriteDirectory" continueOnFail="false">

                <Parameter xsi:type="StringParameter" name="Path" value="#vAgentConfiguration.agentTempDir#\DiskClean" />

                <Parameter xsi:type="StringParameter" name="SourceDirectory" value="VSASharedFiles\ccleaner\" />

              </Statement>

              <Statement description="" name="ExecuteFile" continueOnFail="false">

                <Parameter xsi:type="StringParameter" name="Path" value="#vAgentConfiguration.agentTempDir#\DiskClean\CCleaner.exe" />

                <Parameter xsi:type="StringParameter" name="Arguments" value="/auto" />

                <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="User" />

                <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="True" />

              </Statement>

              <Statement description="" name="PauseScript" continueOnFail="false">

                <Parameter xsi:type="IntegerParameter" name="Seconds" value="300" />

              </Statement>

              <Statement description="" name="DeleteFile" continueOnFail="false">

                <Parameter xsi:type="StringParameter" name="Path" value="#vAgentConfiguration.agentTempDir#\DiskClean\CCleaner.exe" />

              </Statement>

              <Statement description="" name="DeleteFile" continueOnFail="false">

                <Parameter xsi:type="StringParameter" name="Path" value="#vAgentConfiguration.agentTempDir#\DiskClean\CCleaner.ini" />

              </Statement>

              <Statement description="Write an Entry into the Procedure Log" name="WriteScriptLogEntry" continueOnFail="true">

                <Parameter xsi:type="StringParameter" name="Comment" value="CClean completed successfully" />

              </Statement>

            </Then>

            <Else>

              <Statement description="" name="WriteScriptLogEntry" continueOnFail="false">

                <Parameter xsi:type="StringParameter" name="Comment" value="CClean failed. User not logged in." />

              </Statement>

            </Else>

          </If>

        </Body>

      </Procedure>

    </ScriptExport>

     

     

  • I not see any way to attach a file even when using the rich text editor? Can someone point me to a way to attach a file?