I have very little knowledge of networking and so I can not seem to figure out what is going wrong here.
My set up includes a laptop running Windows 10 connected to internet through Wi-Fi and a Raspberry Pi connected to my laptop through Ethernet cable. I ping raspberrypi.mshome.net from command prompt to find ip for the current session and login through Putty.
I was using this headless Raspberry Pi setup without any problem till I tried to configure some /etc/network/interfaces file on the Pi while following a tutorial trying to connect to wlan from the terminal. I was confused about some part and so decided to leave the thing unchanged and decided to work on it later. Next time when I tried to login through putty, connection was refused. I pinged raspberrypi.mshome.net from command prompt and found "request timeout" and sometimes it said "destination host unreachable". When I used AdvancedIpScanner.exe to find ip for all devices on the network, it gave some ip like 169.254.x.y. This ip can be used to login to the Pi. But the way I had been working before that, using ping from command prompt to find ip(192.168.x.y), and connecting through Putty using this ip, is not working anymore.
The IPv4 properties for the local area connection of my laptop is set to "obtain ip address automatically".
I formatted the Pi SD Card, reinstalled the Raspbian Jessie OS and it again worked fine. I connected to my Wi-Fi from Remote desktop and surfed the internet, and it worked fine. But then again, the next time I logged in, the same problem occurred, ie, request timed out when I tried to ping raspberrypi.mshome.net. Now everytime I try to ping Pi, it shows the same ip against the Pi all the time and request times out. I have reinstalled Raspbian but it doesn't change. (It still works if I try to login using the ip 169.254.x.y from AdvancedIpScanner)
I would like to know what has gone wrong as I am stuck here for quite a few days.