@David ***********
that depends on your embassy. As Kool mentioned you can only get it at the Thai embassy in your home country.
But you're probably not going to be let into the country after you try entering again as a tourist after 6-9 months already in the country as a tourist. You can't live in Thailand without a long term visa.