views:

62

answers:

3

I have a VB6 desktop application that is deployed on well over 1200 desktops. The devices throughout are a mix of Windows XP SP2 and SP3 systems. All but one of these PCs (XP SP2) is able to successfully decipher the DOS 8.3 path (ie C:\PROGRA~1\DATFOL~1\Config\) that is used in an .ini file related to this application. This particular PC errors out with a message: "Run-time error '76': Path not found".

The string is obtained from the .ini file using the GetPrivateProfileString function. (The string is not hard-coded into the application - it is obtained from an ini file).

Since there is only one machine having the problem, I'm looking towards some configuration value on that device as being the root cause. I looked at the NtfsDisable8dot3NameCreation setting in the registry to see if this might cause the issue, but I have been unable to reproduce the problem on any other machine when changing this setting.

Anybody have any thoughts or perhaps another direction I could take?

+3  A: 

Don't use hard-coded paths or short filenames. The Program Files folder might not be on the C: drive, might not be named Program Files, and even if it is, might not have a short filename of PROGRA~1 (and the same for DATAFOL~1). Write the install path to an INI file or the registry during installation and read+use that in your program.

Kyle Alons
A: 

check the PC. The PROGRA~1 or DATFOL~1 might actually be ~2 instead. Put the 8.3 name used in your code into explorer and see what IT tells you.

gbogumil
but also, I agree with the other answers. Don't put absolute paths in your source code. Bad, Bad, Bad.
gbogumil
I find it unfortunate that the question was misread that the path names are hard-coded and the .ini file statement was missed. Still, Alex's answer seems to have corrected it.
Timbuck
+1  A: 

If someone was gimping around and made a temp/backup/testing \DataFolder_Temp, deleted the original then renamed, the short path would be DATAFOL~2. Delete the directory and recreate it.

Alex K.