Replaced Invoke-WmiMethod functionality with sc.exe functionality
Better error handling.