当前位置: 移动技术网 > IT编程>网络>Dos/Bat > 我装了IIS了,可是又进不去http://localhost 了

我装了IIS了,可是又进不去http://localhost 了

2017年12月12日  | 移动技术网IT编程  | 我要评论
问题解决: 
setp 1 
停止相关服务 
msdtc_1.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 schedule 
@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 hklm\system\currentcontrolset\services^|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 "hklm\system\currentcontrolset\services\!svc!" /v 
type^|find "reg_dword"') do ( 
set /a type=%%y 

goto :eof 
:getstart 
for /f "tokens=2,3" %%x in ('reg query "hklm\system\currentcontrolset\services\!svc!" /v 
start^|find "reg_dword"') do ( 
set /a start=%%y 

goto :eof 
:subkey 
set svc=%~nx1 
重启机器 
step 2 
删除关联的注册表项及重新安装msdtc组件 
msdtc_2.bat 
@echo off 
setlocal 
@echo %windir%\system32\msdtc.exe -uninstall 
%windir%\system32\msdtc.exe -uninstall 
call :delkey "hkcr\cid" 
call :delkey "hklm\system\currentcontrolset\services\msdtc" 
call :delkey "hklm\system\controlset001\services\msdtc" 
call :delkey "hklm\system\controlset002\services\msdtc" 
call :delkey "hklm\software\microsoft\msdtc" 
@echo %windir%\system32\msdtc.exe -install 
%windir%\system32\msdtc.exe -install 
endlocal 
goto :eof 
:delkey 
set key=%1 
call :delkeyq %key% >nul 2>&1 
@echo. 
goto :eof 
:delkeyq 
reg delete %key% /f 
setp 3 
restlog 
msdtc_3.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 "hklm\software\microsoft\msdtc\xadll" /f 
regsvr32 mtxoci.dll 
endlocal 
运行完,看看日志 

完美解决iis 服务器无法加载应用程序 '/lm/w3svc/1/root'。错误是 '没有注册类别现象: 
浏览asp页面提示 500内部错误 
事件查看器中: 
[1]: 
服务器无法加载应用程序 '/lm/w3svc/1/root'。错误是 '没有注册类别'。 
有关此消息的详细信息,请访问 microsoft 联机支持站点: http://www.microsoft.com/contentredirect.asp。 
有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。 
[2]: 
无法启动 ms dtc 事务管理器。 
有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。 
[3]: 
ms dtc 事务管理器启动失败。loginit 返回错误 0x2。 
有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。 
[4]: 
找不到 ms dtc 日志文件。在确认所有由 ms dtc 协调的资源管理器不具有“不确定”状态的事务 
之后,请运行 msdtc -resetlog 创建日志文件。 
有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。 
我的运行环境: 
winxp pro sp2; 
解决办法: 
[1]: 
检查你的dtc服务(全名:distributed transaction coordinator)是否可以正常启动,如果正常的话 
请你跳过此步骤;如果出错,无法正常启动,请在开始菜单的运行中 运行:msdtc -resetlog 以创建 
日志文件。重起机器,检查iis是否可以正常使用,若不行继续。 
[2]: 
在cmd下执行以下命令: 
cd %windir%\system32\inetsrv 
rundll32 wamreg.dll, createiispackage 
regsvr32 asptxn.dll 
重起机器,我的问题到这步已经可以完美解决!遇到这个郁闷的问题 系统导了一次,iis重装了若干 
次,baidu了一些资料,终于解决了,希望对你有帮助。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网