If you are interested.. Here is a variation of this that I have talked about recently - Re: Citrix Clean up script

It should be pretty simple to modify to what you need.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's