怎么安装DTC服务?
发布网友
发布时间:2022-05-19 23:43
我来回答
共3个回答
热心网友
时间:2023-10-20 09:31
1、删除注册表中的如下三个键
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSDTC
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC
HKEY_CLASSES_ROOT\CID
4、停止MSDTC服务:net stop msdtc
5、卸载MSDTC服务:msdtc -uninstall
6、重新安装MSDTC服务:msdtc -install
7、确认在事件查看器中msdtc服务已经正常启动
8、重启机器
9、在命令行窗口执行
msdtc -resetlog即可。
热心网友
时间:2023-10-20 09:31
第一步:msdtc1.bat
@echo off
if {%1}=={} @echo Syntax: MSDTC1 Filename&goto :EOF
setlocal ENABLEDELAYEDEXPANSION
set filename=%1
if exist %filename% del /q %filename%
(
@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 Schele
@echo LmHosts
@echo winmgmt
@echo Wmi
@echo W32Time
@echo lanmanworkstation
)>"%TEMP%MSDTC1.TMP"
call :stopdtc>nul 2>&1
for /f "Tokens=*" %%L in ('reg query HKLMSystemCurrentControlSetServices^|FINDSTR /I /B /L /C:"HKEY_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%MSDTC1.TMP"') do goto :EOF
set /a start=3
set /a type=0
call :getstart>nul 2>&1
call :gettype>nul 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 start=%%y
)
goto :EOF
:subkey
set svc=%~nx1
然后重启。
第二步:msdtc2.bat
@echo off
setlocal
@echo %WINDIR%System32msdtc.exe -uninstall
%WINDIR%System32msdtc.exe -uninstall
call :delkey "HKCRCID"
call :delkey "HKLMSYSTEMCurrentControlSetServicesMSDTC"
call :delkey "HKLMSYSTEMControlSet001ServicesMSDTC"
call :delkey "HKLMSYSTEMControlSet002ServicesMSDTC"
call :delkey "HKLMSoftwareMicrosoftMSDTC"
@echo %WINDIR%System32msdtc.exe -install
%WINDIR%System32msdtc.exe -install
endlocal
goto :EOF
:delkey
set key=%1
call :delkeyq %key% >nul 2>&1
@echo.
goto :EOF
:delkeyq
REG DELETE %key% /F
第三步:msdtc3.bat
@echo off
if {%1}=={} @echo Syntax: MSDTC3 Filename&goto :EOF
if not exist %1 Syntax: MSDTC3 Filename - %1 was NOT found.&goto :EOF
setlocal
set filename=%1
for /f "Tokens=*" %%r in ('type %filename%') do (
%%r
)
reg add "HKLMSOFTWAREMicrosoftMSDTCXADLL" /F
regsvr32 mtxoci.dll
endlocal
然后查看服务,就可以看到Distributed Transaction Coordinator服务已经可以启动了。
热心网友
时间:2023-10-20 09:32
重新安装一下IIS服务即可解决。