I have written a very simple .NET program for windows that starts up 2 calibre-server.exe processes for a couple of libraries and hides the command windows for the processes. Nothing to it if you can compile c# code. The path to the application is stored in processPath and the port number and library path is passed to the method StartProcess. Just edit to your application path, library path and port number you want to start with.
Code:
--- c# code ---
using System.Diagnostics;
namespace StartBookServer
{
class Program
{
static string processPath = "C:\\Program Files\\Calibre2\\calibre-server.exe";
static void Main(string[] args)
{
StartProcess(processPath, "-p 8080 --with-library \"D:\\Fiction\"");
StartProcess(processPath, "-p 8081 --with-library \"D:\\Non-Fiction\"");
}
// run the process and hide the command window shutting down this app's command window (the '/c' added before the arguments apparently)
private static void StartProcess(string processPath, string processArguments)
{
ProcessStartInfo si = new ProcessStartInfo(processPath);
si.RedirectStandardInput = true;
si.RedirectStandardOutput = true;
si.UseShellExecute = false;
si.Arguments = string.Format("/c {0}", processArguments);
si.WindowStyle = ProcessWindowStyle.Hidden;
si.CreateNoWindow = true;
Process p = Process.Start(si);
}
}
}