Well, this particular project is a workhorse used for testing our products via RS-485. I started with QuickBasic 4.5 (remember that?) under DOS (must have been in the 80's), then over the years I wrote versions for VB 4.0, VB 5.0, VB 6.0 (still being used), QuickC (a Microsoft product), gcc under Linux (still being used also since you can do so much fun stuff under Linux) and now B4J. So there is history and I have tried a bunch of variations over the years.
All versions before B4J allowed saving the main settings file (a map file) anywhere the user wanted. That file contains a lot of settings in addition to the serial port info.
Time has proven that was not a good idea. Users were saving those files everywhere and some settings will definitely affect the ability of the product to pass test, so since B4J makes it easy to store that kind of stuff in a file that is not readily accessible (since Windows hides it by default), I decided to use that and it is definitely an improvement over the previous system.
Turns out that thanks to Windows handling of COM ports, the COM port definitely needs to be adjustable by the user since a given USB/RS-485 adapter can show up as any COM port number.
So I came up with the command line parameters, which make it really easy for me to create a batch file with COM port data and a couple other tidbits and use that to start another instance of the program tailored for a different target. *My* problem is solved.
In most cases, the people in the Test department only need to run one instance of the program at a time and the settings will not change for a while, so in those cases it works very well too. I am now trying to address the less common situation where a particular user (that's not me) needs to have that capability but he/she is not enough familiar with batch files to create one that works and will not mess something else, (and yes, the whole thing is fully documented but as you know, nobody reads manuals) so I thought the program could generate the batch file using the current settings and put it on the desktop and
Bob's your uncle. There really are only 4 settings that are controlled via command line parameters, everything else is still controlled through the main file.
About remote database and other fun stuff, you have to realize we are a US based defense contractor and the restrictions now placed by the government and our company policies on what we can (and mostly cannot) do over the network, or even on the local machine are absolutely mind blowing. The layers of red tape I would have to go through before being allowed to do that are such that I will be retired before that happens (to be honest, I am not that far from that point anyways
If you have heard about Bit9 (yes, the "security" company that was hacked in a spectacular way a couple of years ago allowing hackers to distribute malware along their "security" products), I don't need to say more. Otherwise, you always have
Google
Besides, the settings that I want to save this way are essentially local and machine dependent (what piece of hardware you are actually trying to control and what the local COM port settings are), the settings that I do not want to change that way could be in a central database or common network location, but some machines do not have network access for a variety of reasons.