Note that it will not work for just any executable: the executable must be a Windows Service (i.e. implement ServiceMain). When registering a non-service executable as a service, you’ll get the following error upon trying to start the service:
Error 1053: The service did not respond to the start or control request in a timely fashion.
For some unknown reason (maybe system architecture difference, say you are trying to connect to a 32-bit OS shared printer with a 64-bit client) you may get this error code, here is a trick to save your life.
Make sure you have saved credentials for that shared printer, simplest way to this is type \\IP_ADDRESS or \\Machine_Name of that host, enter and save credentials if you are not in AD.
Add a local printer for same type and driver version you are trying to connect to, use LPTx or COMx as port number when required, atfer installation, you should have a printer in you Control Panel> Devices and Printers.
Type \\IP_ADDRESS or \\Machine_Name of print host machine, and another backslash \ then you will get a dropdown list showing all resources on that host, use downwards arrow on your keyboard to navigate to the printer you are tring to connect. select full path in address bar and copy it like this:
Navigate to Control Panel> Devices and Printers, open Printer Properties of that new printer you have just installed locally, in tab Port, click Add Port, then add a *LOCAL PORT*, in name box, paste full path to that printer you have copied then click Apply or OK all the way.