Yesterday I posted a question (which is still unanswered) regarding a command line problem in windowsNT. I found out what the problem was. Actually windows NT takes dos style file and foldernames, ie, if the pathname is "C:\program files\abc\abc.ntd" then in NT the pathname that is looked for is "C:\progra~1\abc\abc.ntd". Problem also occurs even with short names (within 8 characters) if they have space inside the name.

Now the question is: what is the best way to convert the name like "program files" to dos style name eg"progra~1, without changing anything else. Is there any api ? Please help.