Disk Cleanup

Contents

Disk Cleanup

Description

With three dedicated Nexthink Act remote actions, remove unnecessary files from devices.

  • Recycle Bin and Temporal Files Cleanup: Triggers a campaign to empty recycle bin or to empty recycle bin and remove user temporary files.
  • WinSxS Cleanup: Performs WinSxS folder cleanup.
  • Remove Memory Dump Files: Removes all system memory dump files older than provided number of days.

Platforms

  • Recycle Bin and Temporal Files Cleanup: Windows 10 and 7
  • WinSxS Cleanup: Windows 10
  • Remove Memory Dump Files: Windows 10 and 7

License modules

  • Nexthink Act.
  • Nexthink Engage.

Compatibility

  • Nexthink V6.14 and later.

Script Disk Cleanup

  • Version 3.0.0.0 - Fixed issue affecting deep cleanup. Added input parameter 'RemoveFilesOlderThanDays' and 'MaximumDelayInSeconds'
  • Version 2.0.0.0 - Added campaign to notify about completion of cleanup. Code refactoring. Removed Windows 8.1 support
  • Version 1.0.0.0 - Initial release

Script Description

An assisted-help campaign is triggered to perform a light (recycle bin) or a deep (recycle bin and user temporary files) clean.

Execution context and suggested scheduling

Run the script manually as interactive user.

Parameters

ID Label Description
1 DiskCleanupCampaignId UID of the campaign to allow the user select which cleanup process will be done
2 CleanupCompletedCampaignId UID of the campaign to notify the user about the finish of the cleanup process
3 RemoveFilesOlderThanDays Files accessed less recently than this threshold will be deleted. Provide number of days
4 MaximumDelayInSeconds Maximum random delay set to avoid overloading server hosting virtual machines. Provide number of seconds less than 600

Outputs

ID Label Type Description
1 CleanupSpace Size Space freed

Further Information

All files inside user temporary folder whose last access time is older than 'RemoveFilesOlderThanDays' input parameter, will be removed if deep cleanup option is selected in the campaign. Please note that LastAccessTime could be disabled by default in NTFS. If so, LastWriteTime will be used instead. Parameter 'MaximumDelayInSeconds' can be used to add random script execution delay. It should be used in virtualized environments to spread over time number of I/O requests on server hosting virtual machines.

Script WinSxS Cleanup

  • Version 1.0.0.0 - Initial release

Script Description

Performs WinSxS folder cleanup by using DISM Windows tool.

Execution context and suggested scheduling

Run the script manually as local system.

Parameters

ID Label Description
1 MaximumDelayInSeconds Maximum random delay set to avoid overloading server hosting virtual machines. Provide number of seconds less than 600

Outputs

None.

Further Information

Parameter 'MaximumDelayInSeconds' can be used to add random script execution delay. It should be used in virtualized environments to spread over time number of I/O requests on server hosting virtual machines.

Script Remove Memory Dump Files

  • Version 1.0.0.0 - Initial release

Script Description

The script removes all types of system memory dump files (small, kernel and full) older than provided number of days. The script is designed for Windows 10 and 7.

Execution context and suggested scheduling

Run the script manually as local system.

Parameters

ID Label Description
1 RemoveFilesOlderThanDays Files older than this threshold will be deleted. Provide number of days
2 MaximumDelayInSeconds Maximum random delay set to avoid server overload. Provide number of seconds less than 600

Outputs

None.

Further Information

Parameter 'MaximumDelayInSeconds' can be used to add random script execution delay. It should be used on servers hosting virtual machines to spread the number of I/O requests over time.

Restrictions

  • The script is designed to remove memory dumps only from default locations (%SystemRoot%\MEMORY.DMP and %SystemRoot%\Minidump)