Re: Shortcut

From: TC (aatcbbtccctc_at_yahoo.com)
Date: 02/19/05


Date: 18 Feb 2005 17:36:47 -0800


VBA Dabbler wrote:
> Based on your first suggestion of using a local .bat file to launch
the
> database, I have created one and am successfully launching it. I
have some
> issues with it though from a portability and maintenance standpoint:
> 1. The database is on a corporate server, and potentially
hundreds of
> employees will access it from their respective local machines.
> 2. Those machines have Office 2000, XP, and 2003 on them, and are

> running on the Windows 2000 and XP Professional operating systems
(our IT
> standard).
> 3. Some desktop technicians install Office upgrades in
directories which
> don't correspond to the Microsoft default.
> 4. We will have employee turnover and equipment will change.

Given all that, it seems clear that hard-coding the path is not an
option.

Paul's suggestion of writing a proper Install program, is probably the
way to go.

There *is* a win32 API to return the full path & name of the executable
for a given file extension, but I can't for the life of me remember its
name, & I'm at a public PC, so I don't have any of my resources to
check :-( But I'm not sure you can reference a win32 API from directly
within a batch file.

If you're writing the "batch file" in a scripting language such as
VBScript, the script could examine the registry to get what you want.
This PC does not have Access, so using JPEG files as an alternative
example:

- the so-called default value of key HKEY_CLASSES_ROOT/.jpeg is
"jpegfile"

- the default value of key
HKEY_CLASSES_ROOT/jpegfile/shell/open/command is:
"C:\PROGRA~1\INTERN~1\iexplore.exe" -nohome

The second default value shown above, is the command line to execute
when the user double-clicks a JPEG file. Precisely the same technique
will give you the command line that windows executes when the user
double-clicks an MDB file.

Sorry, but gotta go *right now*! Hope that helps,
TC

> Based on these issues I think that a batch file with command line
> instructions to retrieve the MSACCESS.EXE InstallPath from the
Windows
> Registry would work. However, in browsing the MS KB, I've not turned
up
> anything yet. I've looked at 'regedit.exe', etc. to see if it could
be
> called upon to deliver the InstallPath. - don't have a solution yet.
>
> Following is my .bat file contents:
>
> REM Need to locate a method for retrieving the MSACCESS.EXE
InstallPath
> from the system
> REM registry, and assign that value to 'AccessPath'.
>
> Set AccessPath=C:\Program Files\Microsoft Office\OFFICE11\
> Set DBFile=\\servername\DB_Path\filename.mdb
> Set WrkgrpFile=\\servername\WG_Path\WrkgrpFileName.mdw
>
> "%AccessPath%\MSACCESS.EXE" "%DBFile%" /WRKGRP "%WrkgrpFile%"
>
> Also, when launching the database with the .bat file, the Cmd Window
remains
> open until the Access appliation window is closed or the Cmd Window
is
> manually closed. Do you know of a command line instruction to close
the
> window?
>
> Any suggestions would be most appreciated.
>
> Regards,
> VBA Dabbler
>
> "TC" wrote:
>
> > There are some API calls that return the executable name & path
> > corresponding to a specified file extension (eg. mdb), but
> > unfortunately I don't have access to my information on them, at
this
> > PC.
> >
> > Would it be ok to hard-code the path? It's not something that is
likely
> > to change, IMO.
> >
> >



Relevant Pages

  • Re: Shortcut
    ... Based on your first suggestion of using a local .bat file to launch the ... database, I have created one and am successfully launching it. ... Also, when launching the database with the .bat file, the Cmd Window remains ...
    (microsoft.public.access.security)
  • Bat files
    ... on the close of that database to a Pen drive "F drive". ... When the bat file window closes on click on any key to close that window, ... @echo "Now backing up Search Database, ...
    (microsoft.public.windowsxp.help_and_support)
  • Bat Files
    ... on the close of that database to a Pen drive "F drive". ... When the bat file window closes on click on any key to close that window, ... @echo "Now backing up Search Database, ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Message Alert
    ... You or another user can press the F11 key to show the database window ... So the two strSQL lines needs to be changed also: ... assembled strSQL by pressing Ctrl + G, which opens the Immediate ...
    (microsoft.public.access.modulesdaovba)
  • Re: Access/Comcast/Digital Conversion
    ... I did use the Shift-Key trick and that did open the database object window. ... Tony Toews, Microsoft Access MVP ...
    (microsoft.public.access.tablesdbdesign)

Loading