I think meterpreter will not work if the path have spaces unless you enclose the whole path with quotes, like:
cd "c:\documents and settings" NOT cd c:\documents and settings
even this might not work, give it a try and tell me how it behaved.
to circumvent the whole problem,just use the same concept like what you have done
YOUR SOLUTION: if the folder name has spaces, remove them, use the first 6 characters, then ~1
god bless the old 8.3 days