I want to pass a file path as a parameter to an executable from PHP, and the file path may contain spaces. The executable doesn’t seem to handle quotes around the parameter, so I thought maybe I could pass the short DOS name instead of the long name.
Does PHP know anything about the old-style DOS 8.3 file names?
php/win32 ships with the COM/.net extension built-in. You can use it to create a WSH FileSystemObject and then query the ShortPath property of the File object.
prints e.g.