Where, when and how is %rand% being set?

BTW You don't need "@echo on" as that is the default. smile