Solved
This issue has been resolved now.
Solution - Registry Entry was opened in local computer while running the scripts from remote desktop machine. I have closed the all the remote desktop connections, updated the registry entry and closed it. Then i retried and it worked.