Robins are easily frightened. Consider getting a cat or a dog. Even if the robin isn't killed by your pet, they will most likely be scared back to a safe distance. Also consider getting flash decoration, wind chimes or something similar. The sparkle and the movement may keep them at bay. Also consider the possibility that the robin is pecking at your windows for a reason. Is there something attractive about them?