What\'s the best way in C# to set up a utility app that can be run from the command line and produce some output (or write to a file), but that could be run as a Windows service
A Windows Service is quite different from a normal Windows program; you're better off not trying to do two things at once.
Have you considered making it a scheduled task instead?
windows service vs scheduled task