You can try the Dashed Strokes layer styles in photoshop cs4. Though it's not easy to get it looking right, so you might try adjusting the Size and Scale to get it anywhere close to looking decent. You could also use the Rectangle Tool to draw a path and stroke the path with one of the Square Brushes. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.