VB6 应用程序在单台 PC 上无法进行 8.3 路径转换
我有一个 VB6 桌面应用程序,部署在超过 1200 个桌面上。整个设备都是 Windows XP SP2 和 SP3 系统的混合体。除一台 PC (XP SP2) 之外的所有 PC 都能够成功破译 .ini 文件中使用的 DOS 8.3 路径(即 C:\PROGRA~1\DATFOL~1\Config\
)与此应用程序相关。这台特定的 PC 出错并显示一条消息:“运行时错误‘76’:找不到路径”。
该字符串是使用以下命令从 .ini 文件中获取的 GetPrivateProfileString
函数。 (该字符串没有硬编码到应用程序中 - 它是从 ini 文件中获取的)。
由于只有一台机器出现问题,我希望该设备上的某些配置值是根本原因。我查看了注册表中的 NtfsDisable8dot3NameCreation 设置,看看这是否会导致问题,但在更改此设置时,我无法在任何其他计算机上重现该问题。
有人有什么想法或者我可以采取的另一个方向吗?
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 theGetPrivateProfileString
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不要使用硬编码路径或短文件名。 Program Files 文件夹可能不在 C: 驱动器上,可能未命名为 Program Files,即使是,也可能没有 PROGRA~1 的短文件名(DATAFOL~1 也相同)。在安装过程中将安装路径写入 INI 文件或注册表,并在程序中读取并使用它。
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.
如果有人临时创建了一个临时/备份/测试
\DataFolder_Temp
,删除原始文件然后重命名,那么短路径将是DATAFOL~2
。删除该目录并重新创建它。
If someone was gimping around and made a temp/backup/testing
\DataFolder_Temp
, deleted the original then renamed, the short path would beDATAFOL~2
.Delete the directory and recreate it.
检查电脑。 PROGRA~1 或DATFOL~1 实际上可能是~2。将代码中使用的 8.3 名称放入资源管理器中,看看 IT 告诉您什么。
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.