One quick solution would be to add the command for folder deletion in run once registry key.
Once the package executes on the endpoint it would leave an entry in RunOnce for folder deletion.
The folder would get deleted on next system restart after log-on.
Ok thank you.
But with this way is it possible to execute the script after each log on. It doesn't matter which user log on. It should execute it on all user logon, because the problem is, that the installation file set's always a new start menu folder of the application (teamcenter) after each new user logon....
Well in that case we need to put the entry in Run registry folder instead on RunOnce.
Set this channel property on the channel that contains your script:
make sure the logon.action value matches the phase that executes your script within the package.
You can read more about these channel properties in the BBCA Reference Guide 8.2 on page 238
I was able to solve the problem.