win32com short path name on 2k

B

bytecolor

Hi people,

Using win32com on 2k SP3...
Using win32com on XP Professional SP2...
Why the short vs long names?
 
T

Thomas Heller

bytecolor said:
Hi people,

Using win32com on 2k SP3...
u'C:\\PROGRA~1\\FEATUR~1'

Using win32com on XP Professional SP2...
u'C:\\Program Files\\FeatureCAM'

Why the short vs long names?
That depends on how the com application was registered.

Thomas
 
B

bytecolor

I have no idea how Featurecam registers the type library. I did figure
out that I can get the full name 'C:\Program Files\Featurecam' from
within Featurecam using VBA and the same property I used in Pyhton ->
fc.InstallPath. Why would VBA and Python return two different strings?

This is really driving me nuts, because I know for a fact I was getting
the long name using python on 2k not 3 days ago, but now it's returning
the short name and I haven't changed/installed anything.
 
R

Russell Warren

I've been driven crazy by this type of thing in the past. In my case
it was with the same application (not two like you), but on different
machines, with all supposedly having the same OS load. In some cases I
would get short path names and in others I would get long path names.
I could never figure it out any logical explanation for the behaviour
so I just worked around it (*cough* hack *cough*).

To help you generally get around it, you may not know about these two
functions (both in kernel32)...

GetShortPathName - http://tinyurl.com/nxzkl
GetLongPathName - http://tinyurl.com/r4ey4

You can work out a scheme with these where it doesn't matter what mood
Windows is in when you ask it for a path.

In my case I had another big problem, and that was that it would also
arbitrarily decide to change the case of critical paths.. eg:
"C:\Windows" on one machine, and "C:\windows" on another. That also
drove me bonkers and resulted in some lost years/hair.
 
B

bytecolor

Thanks Russell, those funcs sound familiar. I've probably used them or,
more than likely, read about them in the past.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,294
Messages
2,571,511
Members
48,200
Latest member
SCPKatheri

Latest Threads

Top