Comparing Long And Short File Names

When you reference files in Windows 95, you may encounter situationswhen you are unsure whether you’re working with a long or short file name.This becomes a problem if you are comparing file names or if you are searchingfor a specific file and do not know if it will be given in a long or shortformat. For example, Dir$() will always return a longfile name, but the file you are comparing it to may be entered by a useras either a long or short name.To compare two file names on a level field, you must change them bothto short or to long. Dir$() returns a long file name, so you can take advantageof it as a built-in file name converter. What a plus! Pass it C:PRIVAT~1MYSTUF~1NEWTEX~1.TXTand it will return NEW TEXT DOCUMENT.TXT. The only hitch is that you donot get the path, so you must pass Dir$() to each directory in the path,one by one. To do this, loop backwards through the full path string andlet Dir$() convert each subdirectory. After you get the long file namefrom the path, call Dir$(” C:PRIVAT~1MYSTUF~1″) and get MyStuff back. With each successive call, take the long names that were returnedand concatenate them into a full path string. This process will work evenif you begin with a long file name and path.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS