Page 1 of 1 1
Topic Options
#37504 - 2003-03-06 08:56 PM How do you read path of Access 97 .exe using registry
Writer Offline
Lurker

Registered: 2003-01-07
Posts: 4
Hi,
Have pc's with dual install of Access 97 and Access 2000. How do I read the registry to find the path of Access 97 .exe to use the path in the kix script that runs the app.
This will force this app to run Access 97 as opposed to possibly running the Access 2000 'Convert or Open' dialog box first.

Thanks

Top
#37505 - 2003-03-06 09:16 PM Re: How do you read path of Access 97 .exe using registry
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

To get that kind of information you should to read the Path key in
the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\7.0\Access\InstallRoot section.

Microsoft is using the same structure for the other Office applications.

The code can be something like when you start to run only Office-Access97 version
code:
$access="msaccess.exe"
;
$path=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\7.0\Access\InstallRoot","Path")
IF (Substr($path,len($path),1) <> "\")
$path=$path+"\"
ENDIF
? "access program located at '"+$path+"'"
IF (Exist($path+$access) = 1)
RUN '%comspec% /c start "$path$access" ' ? "starting access"
ELSE
? "access not installed"
ENDIF

The code can be something like when you start to run at least a Office-Access version
code:
$access="msaccess.exe"
;
$path=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\7.0\Access\InstallRoot","Path")
IF (len($path) = 0)
$path=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\8.0\Access\InstallRoot","Path")
ENDIF
IF (len($path) = 0)
$path=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\9.0\Access\InstallRoot","Path")
ENDIF
IF (Substr($path,len($path),1) <> "\")
$path=$path+"\"
ENDIF
? "access program located at '"+$path+"'"
IF (Exist($path+$access) = 1)
RUN '%comspec% /c start "$path$access" ' ? "starting access"
ELSE
? "access not installed"
ENDIF

greetings.

btw: please verifies your registry. we think the 7.0 specification is right for Office 97 version.

[ 06. March 2003, 21:21: Message edited by: MCA ]
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#37506 - 2003-03-06 09:22 PM Re: How do you read path of Access 97 .exe using registry
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
dear,

first version was for MS-Excel97. Replace it with the MS-Acess97 version.
fast reading sometimes.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#37507 - 2003-03-07 03:20 PM Re: How do you read path of Access 97 .exe using registry
Writer Offline
Lurker

Registered: 2003-01-07
Posts: 4
MCA,
Thanks for your help.
I'll give it a shot.

Thanks

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2175 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.051 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org