This works quite well.. Finally a good solution that you can add and remove from your script easily with no headache.

To refresh the Group Token cache in the registry just cut and past this code in your script. Put it in the beginning of your script before Ingroup statements.

DelKey("HKEY_CURRENT_USER\Software\KiXtart\TokenCache")