App.Path returns "short" path name 
Author Message
 App.Path returns "short" path name

First off, this is problem is rooted in XP, not VB.  Please work with me, I
suspect I'll find an answer faster in here....

XP; 5.1.2600, VB6 sp5 app.  When the vb application issues the App.Path, it
returns "C:\PROGRA~1\EXPRES~1" rather than "C:\Program Files\ExpressApp".

There are three different XP machines doing this.  There are 2 other XP, as
well as 6 win2k machines that are returning the long path.

The short path name "problem" has come to light since ONE on the XP machines
now balks when starting the vb app:
"The application failed to initialize properly (0xc0000033)".

This started four days ago when they installed some other application (older
app, but they "need" it).  Since then, this error.  Very odd.

I know they can do a "system restore", but that, I suspect, will not address
the cause.

Does c0000033 = STATUS_OBJECT_NAME_INVALID.  If so, am I thinking correct
that if the short path/file names are wacked, this newly installed app may
have managed to scramble some system file registrations with an incorrect
short path/file name?

Any suggestions?  Remedies?  Job openings?

Thanks.
Steve T.



Sat, 26 Feb 2005 05:27:21 GMT  
 App.Path returns "short" path name

Quote:
> First off, this is problem is rooted in XP, not VB.  Please work with
> me, I suspect I'll find an answer faster in here....

> XP; 5.1.2600, VB6 sp5 app.  When the vb application issues the
> App.Path, it returns "C:\PROGRA~1\EXPRES~1" rather than "C:\Program
> Files\ExpressApp".

Is that a problem?  The path should work anyway.

Quote:
> There are three different XP machines doing this.  There are 2 other
> XP, as well as 6 win2k machines that are returning the long path.

Any difference if you start VB and then open the project rather than
double-clicking the VBP file?  The latter causes VB to use short paths
unless you've edited the registry.

[HKEY_CLASSES_ROOT\VisualBasic.Project\shell\open\command]
default="C:\Program Files\Microsoft Visual Studio\VB98\vb6.exe" "%1"

The standard install does not have the quotes around the %1 argument and
that causes Windows to start the app using the short pathname.  Adding the
quotes changes it to use the long pathname (at least in Win95 through
Win2K - haven't tried XP yet)



Sat, 26 Feb 2005 05:43:35 GMT  
 App.Path returns "short" path name
The problem, as I suspect, is that if the "short" filenames did get screwed
up, then when the other app was installed and registered system components
with short filenames, my vb app is now out of luck with it's system
components.

My vb app has been running for a couple of months on these machines.  The
application logs listed the short paths, but, as you noted, it didn't make a
difference to the application.

What matters now, as I suspect, is registered system files.  XP reports the
"application failed to initialize properly (0xc0000033)" error, not the VB
app.  This, with the noted short paths leads me to believe that the short
file names have become "scrambled" so when the OS attempts to initialize my
app, it is looking in the wrong place for some system (or external) file.
Again, this all started 4 days ago.

I could be all wrong, but it sure looks like it to me.  Either way, I need
to cure this one system!  Reinstalling my app had no affect (according to
the user).

Steve T.


Quote:


> > First off, this is problem is rooted in XP, not VB.  Please work with
> > me, I suspect I'll find an answer faster in here....

> > XP; 5.1.2600, VB6 sp5 app.  When the vb application issues the
> > App.Path, it returns "C:\PROGRA~1\EXPRES~1" rather than "C:\Program
> > Files\ExpressApp".

> Is that a problem?  The path should work anyway.

> > There are three different XP machines doing this.  There are 2 other
> > XP, as well as 6 win2k machines that are returning the long path.

> Any difference if you start VB and then open the project rather than
> double-clicking the VBP file?  The latter causes VB to use short paths
> unless you've edited the registry.

> [HKEY_CLASSES_ROOT\VisualBasic.Project\shell\open\command]
> default="C:\Program Files\Microsoft Visual Studio\VB98\vb6.exe" "%1"

> The standard install does not have the quotes around the %1 argument and
> that causes Windows to start the app using the short pathname.  Adding the
> quotes changes it to use the long pathname (at least in Win95 through
> Win2K - haven't tried XP yet)



Sat, 26 Feb 2005 06:04:49 GMT  
 App.Path returns "short" path name

The problem, as I suspect, is that if the "short" filenames did get screwed
up, then when the other app was installed and registered system components
with short filenames, my vb app is now out of luck with it's system
components.

My vb app has been running for a couple of months on these machines.  The
application logs listed the short paths, but, as you noted, it didn't make a
difference to the application.

What matters now, as I suspect, is registered system files.  XP reports the
"application failed to initialize properly (0xc0000033)" error, not the VB
app.  This, with the noted short paths leads me to believe that the short
file names have become "scrambled" so when the OS attempts to initialize my
app, it is looking in the wrong place for some system (or external) file.
Again, this all started 4 days ago.

I could be all wrong, but it sure looks like it to me.  Either way, I need
to cure this one system!  Reinstalling my app had no affect (according to
the user).

You can convert a short path name to a long on the fly:

HOWTO: Get a Long Filename from a Short Filename
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q154822&


Microsoft MVP (Visual Basic)



Sun, 27 Feb 2005 00:52:45 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. App.Path only returning short path name - Why?

2. app.path only returns short path name

3. SysCmd 603, "path","path"

4. Changing Long Paths to Short Paths in a 16-bit App

5. Problem with "app.path"

6. Help: App.Path returns 8.3 path in VB4/Win95

7. Why doea App.Path use "~1" short file names

8. Make "My Computer" default file path

9. Access '95: "Path Not Found"

10. ***URGENT*** : get "Start Menu\Programs" path

11. VB5 Database, "Not a valid path"

12. "Invalid Path" when opening database

 

 
Powered by phpBB® Forum Software