473,666 Members | 2,461 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

win32com short path name on 2k

Hi people,

Using win32com on 2k SP3...
import win32com.client as w32c
fc = w32c.Dispatch(' Featurecam.Appl ication')
fc.InstallPath u'C:\\PROGRA~1\ \FEATUR~1'
Using win32com on XP Professional SP2... import win32com.client as w32c
fc = w32c.Dispatch(' Featurecam.Appl ication')
fc.InstallPath u'C:\\Program Files\\FeatureC AM'


Why the short vs long names?

--
bytecolor

Apr 26 '06 #1
4 1849
bytecolor wrote:
Hi people,

Using win32com on 2k SP3...
import win32com.client as w32c
fc = w32c.Dispatch(' Featurecam.Appl ication')
fc.InstallPath u'C:\\PROGRA~1\ \FEATUR~1'

Using win32com on XP Professional SP2... import win32com.client as w32c
fc = w32c.Dispatch(' Featurecam.Appl ication')
fc.InstallPath

u'C:\\Program Files\\FeatureC AM'

Why the short vs long names?

That depends on how the com application was registered.

Thomas

Apr 26 '06 #2
I have no idea how Featurecam registers the type library. I did figure
out that I can get the full name 'C:\Program Files\Featureca m' 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.

--
bytecolor

Apr 26 '06 #3
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)...

GetShortPathNam e - 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.

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

--
bytecolor

Apr 26 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
17023
by: vithi | last post by:
Hi' I am trying to launch an application. When I try like that When I try like that Excel is opening import win32com.client object = win32com.client.Dispatch("Excel.Application") object.Visible = 1 But when I try my application which is QeepIt.exe which is in the c:\ drive it is not running Any body tell me how to give path to open an exectable application in
3
3138
by: vml | last post by:
Hello, I am really new in python scipy win32com and scipy I tried to setup a COM server to interact with vb 6 the pythom COM server is : from win32com.server import exception, register import pythoncom, win32pdhutil, winerror import math import numpy import sys
1
2743
by: Mark Morss | last post by:
Is this the place to ask a win32com.client question? I am a unix person trying to run on windows, so I have little familiarity with this module. I have this code: import win32com.client """An Access connection""" def connect(data_source, user, pwd, mdw): connAccess = win32com.client.Dispatch(r'ADODB.Connection')
11
7700
by: Bill Davy | last post by:
I am trying to edit Contacts in Outlook. This is so I can transfer numbers from my address book which is an Excel spreadsheet to my mobile phone. I came across the following snippet of code which enabled me to the contacts at least list. I had to root around to discover CdoDefaultFolderContacts (though it was guessable; how could I enumerate win32com.client.constants?). I now want to work through the Contacts in Outlook patching in...
0
8454
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8362
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8878
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8785
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1778
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.