How to remove temp files in the root drive


Article ID: 179718


Updated On:


Patch Management Solution for Windows





How do I remove temp folders left in the root drive when the patching process is incomplete?


Run the attached script with a ? to get usage.
The script does a number of things:

  1. Attempts to determine which folders are left over from failed software update installations.
  2. Moves the temporary folders into a subdirectory of the root folder. The default is C:\AltirisFailedMSUpdatesTempFolder.
  3. Delete subfolders in the AltirisFailedUpdatesTempFolder that are older than 14 days (default).

By default it runs in "list only" mode. This is a trial run mode, which will just show what files are to be moved or deleted.
To save output, just redirect at the command line. For example,  MSPatchTempFolderCleanUp.vbs /listonly:false > c:\temp.log
Directory matching info:

  • At least 10 characters. 
  • Contains only the character A–F or 0–9. 
  • Must not be all numeric or all alphabetic 
  • May not contain and white spaces or special characters

It would be recommended to run this script on a schedule as folders moved into the temporary directory will not get removed unless the script is run again.


MSPatchTempFolderCleanUp.vbs get_app
MSPatchTempFolderCleanUp.vbs get_app