Tuesday, October 5, 2010

Repair and Fix Windows Services

Repair and Fix Windows Services: -

Some times you want to start a stopped service on your server but it fail throwing warning message something like “could not start”, “dependency failed”… etc.

This may happen when your server is infected, compromised or hacked.

Windows services can be fixed easily in a quick way with the help of a batch script. This script checks for all Windows services, its dependencies and repair if found anything wrong with them.

FIX :

You have to create a .bat file say WMI.bat

Edit this file and copy following script in it.

@echo on
cd /d c:\temp
if not exist %windir%\system32\wbem goto TryInstall
cd /d %windir%\system32\wbem
net stop winmgmt
winmgmt /kill
if exist Rep_bak rd Rep_bak /s /q
rename Repository Rep_bak

net start winmgmt
goto End

:FixSrv
if /I (%1) == (wbemcntl.exe) goto SkipSrv
if /I (%1) == (wbemtest.exe) goto SkipSrv
if /I (%1) == (mofcomp.exe) goto SkipSrv
%1 /RegServer

:SkipSrv
goto End

:TryInstall
if not exist wmicore.exe goto End
wmicore /s
net start winmgmt
:End

Execute this WMI.bat file on command prompt and it will start listing the name of Windows services and their repair status.

Reboot the server once script is competed.

Hope this helps you to fix your Windows Server broken services

No comments:

Post a Comment