Fixed windows home directory bug

This line failed on my windows system. The regex '~' removed the '\' from the path, resulting in an invalid path. My way is faster and more secure.