I found the easiest solution was to just (1.) run the sql to detach via .Net (I was executing this via an intranet admin web page) and then (2.) use .Net API to copy the files in one function. Make sure that the user your .Net app is running as has access to the server you're moving the databases to. In other words, you may need to impersonate a domain level account. Does this help? I'm not sure why I couldnt use xp_cmdshell, but my best guess is I didn't have sysadmin permissions configured correctly as bbychkov mentioned.
Hope this helps,
Brett