Multiple instances of apps

Edited

How to set up Rossware utilities for multiple unique instances

Regarding utilities like the EmailedDispatchReceiver and SB-DispatchLink, some users want to run multiple instances, each setup to work with a different background entity and account. The absence of a resolution creates an issue if you wish to have each such instance run from the same desktop. The reason is that each instance will typically save its settings to the same location. Thus, if you set up one instance with a particular configuration and then another instance configured differently, the second instance’s settings will overwrite what was saved for the first instance.

There is a simple solution to this problem.

Windows has a little internal function whereby, when any application is started, Windows is willing to pass to the application what is called a “Command Line Argument.” We take advantage of this function.

Specifically, you will configure it so that as each of your multiple instances is started, Windows simultaneously passes what is a unique-to-that instance string of characters to it. After receiving this string from Windows as it starts, the application knows to save and read its settings in a unique place — on the specific basis of that string.

To do this setup is very easy. You can use either of two methods:

Method 1: Use multiple modified Windows Desktop shortcuts

You likely already know how to create a Windows desktop shortcut. With this method, you'll create a separate shortcut for each instance of an application that you wish to run multiple unique instances of. Regarding each shortcut, you'll open its Properties window (right-click on the shortcut and select "Properties"). In the box that's labeled "Target," you'll simply add an expression (whatever expression you wish) that uniquely identifies the instance of the application it is that you want this shortcut to start:

This little addition of text is passed by Windows to the application as its Command Line Argument.

Method 2: Make a single batch file to start all of your unique instances of multiple applications

It could make for many different desktop shortcuts if you want multiple instances of multiple applications. If so, using this method might be cleaner and easier.

Start by opening Notepad (click on Windows Start and type “Notepad” to find it). In Notepad, type a single line of text for each instance of any application you wish to run multiple instances on. Each line begins with the word “START”. Following is the file spec for the application itself. Then is the unique string you want to use to identify each particular instance (it's what's passed by Windows to the app as its command-line-argument when Windows starts the app). For example, your text might look something like this:

  • START z:\sd\SB-DispatchLink.exe ForAccnt541892

  • START z:\sd\SB-DispatchLink.exe ForAccnt981858

  • START z:\sd\SB-DispatchLink.exe ForAccnt088181

  • START z:\sd\EmailedDispatchReceiver.exe ForAHS

  • START z:\sd\EmailedDispatchReceiver.exe ForCHW

Now, you must save your text in a “batch file.” To save as a batch file is darned easy. All you must do is pick any name and location you want but give it a “.bat” extension. Thus (and as an example), you might save it to your desktop under “StartMyMultipleInstanceApps.bat.”

Now, you must double-click on that file to run it. It will instantly start each instance as described in each line, passing the unique string to each instance. Each instance will see that unique string passed to it and know to save and read its settings accordingly.

Please place a shortcut to this batch file in the Windows Startup folder to ensure all of these starts happen automatically as Windows is periodically rebooted. It’s that simple.

If you need help creating and setting up this file, our support staff will gladly help you.

As of November 2018, we have placed this capability into SDML, EDR, SBDL, SPDL, and SSDL. If you need the capability in other apps, please let us know.