06/03/2015
Hey reader,
Download defraggler and ccleaner portable versions. Put them on a network location and change <files location> to the network location. So that the locations match up.
You could then run this script with Sysinternals PSEXEC or through the Windows Task Scheduler.
Enjoy your clean computer.
echo off
echo.
echo --- System Maintenance started @ %time% ---
echo.
if exist %systemdrive%\temp\ ( echo %systemdrive%\temp\ exists )
ELSE ( mkdir %systemdrive%\temp\ && echo %systemdrive%\temp\ created)
xcopy <files location>\cc %systemdrive%\temp\cc /Y /i /S| echo Copying ccleaner files
xcopy <files location>\df %systemdrive%\temp\df /Y /i /S | echo Copying defraggler files
copy <files location>\clean.reg %systemdrive%\temp\clean.reg /Y | echo Copying registry key
regedit /s %systemdrive%\temp\clean.reg | echo Deploying registry key
echo.
START /WAIT %systemdrive%\temp\cc\ccleaner64.exe /AUTO | echo ccleaner is running
echo ccleaner is done
START /WAIT %systemdrive%\temp\df\df64.exe C:\ /Large *.* 150 | echo defraggler is running
echo defraggler is done
cleanmgr /sagerun:11 | echo Disk cleanup is running
echo Disk cleanup finished
echo.
echo --- System maintance complete @ %time% ---
echo.
exit