Converting a desktop application with a GUI to a console application

This might sound a little strange but I'll try nevertheless.
Imagine a large GUI desktop application build using Qt and now you would want to have parts of the application to be run as a console application or even as a service on windows.
Clearly the application can be "reconfigured" (eliminate all GUI ) in the source code using the precompiler but I was wondering if there are any best practices on how to solve this ?
Thank you in advance.

I complete agree in that a perfect separation of business logic an user interface should make this quite simple but unfortunately this is not the case with "this" application. :-(
We have gone a different path and simply created a new path that prevents any user interaction to actually stop the application and wait for user input.
This is not perfect but (at least in our case) solves the problem of running the application in batch mode.