2024年3月12日发(作者:)

@echo Alerter

@echo EventSystem

@echo Browser

@echo TrkWks

@echo Dnscache

@echo Eventlog

@echo PolicyAgent

@echo dmserver

@echo Messenger

@echo Netlogon

@echo NtLmSsp

@echo Netman

@echo PlugPlay

@echo RpcSs

@echo RpcLocator

@echo NtmsSvc

@echo SamSs

@echo lanmanserver

@echo SENS

@echo Schedule

@echo LmHosts

@echo winmgmt

@echo Wmi

@echo W32Time

@echo lanmanworkstation

)%TEMP%

call stopdtcnul 2&1

for f Tokens= %%L in ('reg query HKLMSystemCurrentControlSetServices^FINDSTR I B L CHKEY_LOCAL_MACHINE') do

(

set line=%%L

set key=HKLM!LINE~18!

call subkey !key!

call testsvc

)

endlocal

goto EOF

stopdtc

sc stop msdtc

goto EOF

testsvc

for f Tokens= %%c in ('@echo !svc!^findstr I B E L G%TEMP%') do goto EOF

set a start=3

set a type=0

call getstartnul 2&1

call gettypenul 2&1

if %type% LSS 16 goto EOF

if %start% NEQ 2 goto EOF

sc config !svc! start= demand

@echo sc config !svc! start= auto%filename%

goto EOF

gettype

for f Tokens=2,3 %%x in ('reg query HKLMSystemCurrentControlSetServices!svc! V type^FIND REG_DWORD') do (

set a type=%%y

)

goto EOF

getstart

for f Tokens=2,3 %%x in ('reg query HKLMSystemCurrentControlSetServices!svc! V start^FIND REG_DWORD') do (

set a star

t=%%y

)

goto EOF

subkey

set svc=%~nx1

重启机器

step 2

删除关联的注册表项及重新安装msdtc组件

MSDTC_

@echo off

setlocal

@echo %WINDIR% -uninstall

%WINDIR% -uninstall

call delkey HKCRCID

call delkey HKLMSYSTEMCurrentControlSetServicesMSDTC

call delkey HKLMSYSTEMControlSet001ServicesMSDTC

call delkey HKLMSYSTEMControlSet002ServicesMSDTC

call delkey HKLMSoftwareMicrosoftMSDTC

@echo %WINDIR% -install

%WINDIR% -install

endlocal

goto EOF

delkey

set key=%1

call delkeyq %key% nul 2&1

@echo.

goto EOF

delkeyq

REG DELETE %key% F

step 3

restlog

MSDTC_

@echo off

if {%1}=={} @echo Syntax MSDTC3 Filename&goto EOF

if not exist %1 Syntax MSDTC3 Filename - %1 was NOT found.&goto EOF

setlocal