The output of this query can be used to create a batch file to execute service control to fix BITS service.

  • Open  SQL  Server Management Studio and paste this query.
  • Edit it as you need.
  • Execute the query
  • Save the result panel as fixbits.bat
  • Finally open a DOS Prompt
  • Make sure that sc.exe is located within the path.
  • Run fixbits.bat




‘sc \\’+CS.Name0 +‘ sdset bits “bla bla”‘


      dbo.v_GS_SERVICE S left outer join dbo.v_GS_Computer_system cs on CS.ResourceID = S.ResourceID


      (displayname0 = ‘Background Intelligent Transfer Service’) and

      ( State0 != ‘Running’ or isnull(State0, ‘NULL’) = ‘NULL’)