01-07-2021 12:39 AM
01-07-2021 03:38 AM - edited 01-07-2021 03:42 AM
Only device drivers and services can startup before a user session is started. Turning your application into a device driver is not an option, but there exist tools, also from Microsoft, that can wrap an exe and start it as service.
I personally also developed a library that can allow a LabVIEW application to directly act as a service without an additional wrapper, but can't post it. Development of that requires to call several Windows API functions and processing callbacks, which requires to program an external DLL that does part of this work on behalf of your LabVIEW program. It's only an option for someone who can write C code too, and not just a basic "Hello World" C program at that.
Searching for LabVIEW Windows Service here should give you quite a few relevant links.
01-07-2021 04:31 AM
I haven't had an actual need for this myself, but I did recently need to check it and my basic tests with NSSM seemed to indicate that it did everything I needed it to - https://nssm.cc/
As far as I know, people have said that the Microsoft tool (srvany) is problematic with later versions of Windows.
01-07-2021 04:44 AM
Task scheduler can start executables before login. At least, I' pretty sure I did that before. It will run any exe as a service.
Task scheduler has a command line interface, so it is possible to automate installation of the service.
The exe won't have a GUI though, as it is started as a service, and services can't have GUIs.
01-07-2021 08:07 AM