Follow the below-mentioned steps to install Zookeeper on Windows.
First, download Zookeeper from http://zookeeper.apache.org/releases.html#download
Then open command prompt, switch to the folder where zookeeper was downloaded and extract the files
$ tar -xvf zookeeper-3.4.12.tar.gz
Open a windows explorer and go to the zookeeper folder and under that go to conf folder. You will find a file named zoo_sample.cfg, create a duplicate of this file and name it zoo.cfg and open it with a text editor.
Find the entry dataDir=/tmp/zookeeper and change the value of dataDir to the zookeeper folder like this:

And save the file.
Finally, you have to add the path. Refer to the below screenshots:




That’s it. To start Zookeeper, open command prompt and run:
> zkserver
You can refer this to know how to install Spark: https://www.edureka.co/community/38855/installing-spark-on-windows