Sunday, December 27, 2015

C:\_SMSTaskSequence not being deleted

Recently I have to deploy an application which had few apps to be uninstalled and re-installed following multiple reboots in a sequence.
Based on the complexity of the application, I have used a custom task sequence and added all the apps to the task sequence.
The deployment worked fine, however some of the machines failed to remove C:\_SMSTaskSequence folder.
I have tried using various options but still no go.
Eventually i have to add RunOnce registry Key to remove this folder on next reboot.

So here is the easy way to get the key created;
Add a Run Command line step at the end of your task sequence after all the reboots, then add following command in command line window;
REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce /v "SMSTSCleanup" /t REG_SZ /d "CMD /C RMDIR /S /Q C:\_SMSTaskSequence" /f
That’s it. On next reboot, the folder will be removed.

No comments:

Post a Comment