I suspect you don't really need GetShortpathName,
so I'm gonna ask: Why do you think you need to use GetShortpathName?.
If you're doing exec/system/open there are variants of each which avoid the shell, so spaces in paths aren't significant.
MJDsays "you can't just make shit up and expect the computer to know what you mean, retardo!"