My apologies, I had the "order of events" wrong then.
Looks like Hanshi found the source of the problem, and I suspect the reason it may work when you key in the path or do it through a query window, is SQL isn't trying to run the XP_Fixeddrives.
Jason