Damned or cursed (mild exclamation); adjective form expressing annoyance at something; or past tense of 'drat.'
From 'drat' + past tense suffix '-ed.' 'Drat' itself is likely a euphemistic corruption of 'damn' or possibly 'darned,' creating a chain of increasingly mild substitutes.
'Dratted' appears constantly in British children's literature and Roald Dahl books because it let authors express frustration in words kids could read without parents objecting—it's a perfectly calibrated social curse word.
Complete word intelligence in one call. Free tier — 50 lookups/day.