Symptoms |
---|
This document outlines how to use a Custom Action to delete a specific file from a target machine.
Steps |
---|
This custom action uses the CMD syntax to delete a file. Because Custom Actions are run as the Local System account, they must be run in a silent/unattended/quiet mode as no prompts will show up on a target machine for a user.
- Create a NewDeployment Template;enter a Name for theTemplate, andSaveit.
- Alternatively - open an existingDeployment Templateyou wish to modify.
- Click theCustomActionstab.
- Click theNewoption.
- In the Custom Actions window, leave Step 1 as 'All deployments using this template', Step 2 will remain disabled, Step 3 set to 'Before any patches', and Step 4 enter the following:DEL /Q "PATH TO SPECIFIC FILE"
- DEL- Delete one or more files.
- /Q- Quiet mode, do not give a Yes/No Prompt before deleting.
- "PATH TO SPECIFIC FILE"- The full path to the file that should be deleted.
Example:DEL /Q "C:\Windows\ProPatches\Patches\Wireshark-win64-1.8.9.exe"
This would Quietly delete the Wireshark patch located at C:\Windows\ProPatches\Patches\ on the machine we deployed to.
More Info: http://ss64.com/nt/del.html
- Deploy the null patch (or use with any other patch deployment) and before the patches are installed the command to delete the specific file will execute.