    # File lib/chef/provider/service/windows.rb, line 83
      def stop_service
        begin
          if @new_resource.stop_command
            Chef::Log.debug "#{@new_resource} stopping service using the given stop_command"
            popen4(@new_resource.stop_command) do |pid, stdin, stdout, stderr|
              Chef::Log.debug stdout.readlines
            end
          else
            popen4("#{@init_command} stop #{@new_resource.service_name}") do |pid, stdin, stdout, stderr|
              output = stdout.readlines
              Chef::Log.debug output.join
              raise Chef::Exceptions::Service, "Service #{@new_resource.service_name} has dependencies and cannot be stopped.\n" if output.join =~ /FAILED 1051/
              output.join =~ /1/
            end
          end
        rescue Exception => e
          raise Chef::Exceptions::Service, "Failed to start service #{@new_resource.service_name}: #{e.message}"
        end
      end