devxlogo

App.Path Might Return UNC Path Specifications

App.Path Might Return UNC Path Specifications

Unlike VB4, VB5””””s App.Path property might return a UNC path, such as “\serverprograms…”), undercertain circumstances, depending on how the program started and if it””””s interpreted in the VB IDE orcompiled as a standalone EXE. This change likely affects all applications that use App.Path to set the currentdirectory when the program starts:

 ChDrive App.PathChDir App.Path

In fact, because ChDrive cannot handle UNC paths, the code might raise a fatal runtime error, and shouldbe protected using an On Error Resume Next statement. This fix, however, doesn””””t protect you under everypossible condition. The best approach is to give the end user the capability to set the application directory atrun time, then save the entered value in the registry or in an INI file. For more information on this problemand its possible solutions, see article Q167167 in the Microsoft Knowledge Base.

See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist