Install Kafka as windows service
Perform all the pre-requisites and installation steps as specified in:
Setting Up and Running Apache Kafka on Windows OS
Complete all the steps till step 6 of section C.
(i) Use NSSM (a FREE service manager) and enter the below in Path and Arguments, to create a Windows service for ZooKeeper:
Path: <ZooKeeper directory>\bin\windows\zookeeper-server-start.bat
Arguments: <ZooKeeper directory>\config\zookeeper.properties
(ii) Use NSSM (a FREE service manager) and enter the below in Path and Arguments, to create a Windows service for Kafka:
Path: <Kafka directory>\bin\windows\kafka-server-start.bat
Arguments: <Kafka directory>\config\kafka.properties
Provide a dependency of ZooKeeper service (under the Dependencies tab in the NSSM setup of Kafka), so that when you startup Kafka service, ZooKeeper service is automatically started (if it isn't running already).
NB: Please note that ZooKeeper ships with Kafka, and the binaries to start and stop the ZooKeeper service is found in the same <Kafka directory>\bin\windows\
directory.
Hope it explains!