It is easy to generate particles to make their trajectory to be a circle by using particle designer.My problem is how to make the track to be a rectangle?
If you mean to move the individual particles from one corner of a rectangle to another, then the answer is: You can't.
You can however move the particle system itself. If the system spawns particles with no speed/direction (ie particles stay in place) and you move enough particle system instances in rectangular fashion yourself (ie with sequenced CCMoveTo) you may be able to achieve what you want.