Run the command prompt as administrator. Then type the following:
#netsh wlan show drivers
if hostednetwork=yes, proceed and type the following on the CMD
#netsh wlan set hostednetwork mode=allow ssid=hostname, key=password. //creating the hosted
NB: hostname is what you wish to call the network to be shared. And password is the password.
The hosted network is now created but it is still offline so you have to start it as below.
#netsh wlan start hostednetwork //start the hosted network
#netsh wlan stop hostednetwork //stop the hosted network.
On the control panel click on the properties of the current network you are using. Then allow sharing.