World Map
Java Service Wrapper is the easiest way to make your product more reliable.
  • Free Trial
  • Buy Now

HowTo: How to access Windows shares

Compatibility :3.5.0
Editions :Professional EditionStandard EditionCommunity Edition (Not Supported)
Platforms :WindowsMac OSX (Not Supported)Linux (Not Supported)IBM AIX (Not Supported)FreeBSD (Not Supported)HP-UX (Not Supported)Solaris (Not Supported)IBM z/OS (Not Supported)IBM z/Linux (Not Supported)

The Java Service Wrapper provides a set of "share" configuration properties which can be added to the Wrapper's configuration file to tell the Wrapper to set up one or more network drive or printer mappings before the Java application is launched.

These are used in combination with properties to configure the Windows account which is used to run the service.

Simple Mapping of Public Share

Many organizations have common share drives which can be accessed by anyone with access to the network. These are by far the easiest to set up as they only require a location to be mapped, and the drive letter (alphabet indicating a drive) to map it to.

Configuration Example:
wrapper.share.1.location=\\myfileserver\commonshare
wrapper.share.1.target=S:
wrapper.share.1.type=DISK

Once this is set up, the application will be able to access the "S:" drive in the same way as any other local drive. This is a very simple example which does not provide any authentication credentials, handle connection failures, or specify what to do with the mapped drive when the service stops.

Mapping of Public Share with Authentication

It is common for network drives to be protected by a password such that access is only given to specific accounts. The Wrapper makes it possible to specify a particular account to connect as, and optionally specify a password for the account.

Configuration Example:
wrapper.share.1.location=\\myfileserver\commonshare
wrapper.share.1.target=S:
wrapper.share.1.account=domain\user
wrapper.share.1.password=password

If the user account that the Wrapper is running as has access to the shared network, then it may not be necessary to specify an account and password even though access to the share is restricted.

Mapping of a Network Printer

Printers that are located on a remote machine can also be mapped in much the same way as a drive. The difference is that a printer port is specified rather than a drive letter:

Configuration Example:
wrapper.share.1.location=\\myserver\printer
wrapper.share.1.target=LPT2:
wrapper.share.1.type=PRINTER