Fixed issues in the script

1. Fixed issues related to registration with service-nanny.
2. Fixed issues pertaining to log and run folders.
3. Fixed issues related to path of executables.