Command line switches exceeding Max Character Limit

G

Guest

"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
"\\insseafs0a\insall\Business Process Management\Impact Analysis\Impact
Analysis.mdb" /Wrkgrp "\\insseafs0a\insall\Business Process Management\Impact
Analysis\Impact.mdw" /user "UsrName" /pwd "Password"

Is there a way to get rid of the path reference to MsAccess.exe, so that I
can fit all the characters in the rest of the line:

"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"

In general, how does one go about handling the limitations here.
 
D

Douglas J. Steele

You must have the reference to msaccess.exe: the switches are switches for
the executable, and therefore the executable must be in the command line to
receive the switches.

You could try converting the paths to their short file name equivalents. For
instance, "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" would
probably be C:\Progra~1\Micros~1\Office10\MSACCESS.EXE

http://www.mvps.org/access/api/api0020.htm at "The Access Web" is code that
will help you determine the correct short file names.
 
D

david epsom dot com dot au

Yes, you can change the registration for .mdb files so
that Windows expects parameters 2, 3, 4, etc.

The system is not very flexible, and normally if you
specify extra parameters, windows will give you an error
message if they are not provided - so double clicking
on an mdb after changing the registration would always
give you an error message, which you can ignore.

Another solution is to change the extension on the
access file, so that you can create a new registration,
with more command line parameters as required.

And that still only helps you with the Access path -
the other paths are still long.

A better solution is to define an access profile,
so that the workgroup path does not have to be
included at all:

....msaccess.exe /profile myprofile /user "usr" ...

Like file associations, profiles definitions go
in the registry: look in the Access help for information
on using profiles.

And somewhere, there is a setting which adjusts
the maximum allowable length for command lines.

But traditionally, the normal solution to this problem
is to NOT USE LONG NETWORK PATHS. The path to Access
would not matter if you were using simple 8 character
folder names for your network folders.

You can (unless the feature is disabled) use the
short names for your long folder names, for example
progra~1 instead of "program files", (you can get
the short names by doing a directory listing from
the command prompt) but how much easier just to use
short hames for your network folders in the first
place!

(david)
 
G

Guest

Thanks to both of you, that was very helpful!

david epsom dot com dot au said:
Yes, you can change the registration for .mdb files so
that Windows expects parameters 2, 3, 4, etc.

The system is not very flexible, and normally if you
specify extra parameters, windows will give you an error
message if they are not provided - so double clicking
on an mdb after changing the registration would always
give you an error message, which you can ignore.

Another solution is to change the extension on the
access file, so that you can create a new registration,
with more command line parameters as required.

And that still only helps you with the Access path -
the other paths are still long.

A better solution is to define an access profile,
so that the workgroup path does not have to be
included at all:

....msaccess.exe /profile myprofile /user "usr" ...

Like file associations, profiles definitions go
in the registry: look in the Access help for information
on using profiles.

And somewhere, there is a setting which adjusts
the maximum allowable length for command lines.

But traditionally, the normal solution to this problem
is to NOT USE LONG NETWORK PATHS. The path to Access
would not matter if you were using simple 8 character
folder names for your network folders.

You can (unless the feature is disabled) use the
short names for your long folder names, for example
progra~1 instead of "program files", (you can get
the short names by doing a directory listing from
the command prompt) but how much easier just to use
short hames for your network folders in the first
place!

(david)
 

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

Top