@ Echo off
Echo *
Echo *
Echo *************************************** *************
Echo **
Echo * IIS server application error Automatic Repair Batch Processing *
Echo * Author: Hayden *
Echo * blog: www.mysuc.com *
Echo **
Echo *************************************** *************
Echo *
Echo *
Set/P isok0 = start IIS repair? (Y/N)
If % isok0 % = y goto begin
Goto forend
: Begin
Set useriwam = IWAM _ % computername %
Set useriusr = IUSR _ % computername %
: Checkiwam
Net user % useriwam %
If % errorlevel % = 0 goto checkiusr
Goto netuseriwam
: Checkiusr
Net user % useriusr %
If % errorlevel % = 0 goto edituser
Goto netuseriusr
: Netuseriwam
Net user
Set/P tiwam = enter the correct "Start IIS process account" Name (that is, the account name starting with IWAM )?
Set useriwam = % ans %
Goto checkiwam
: Netuseriusr
Net user
Set/P tiusr = enter the correct "Internet Guest Account" Name (that is, the account name starting with IUSR )?
Set useriusr = % tiusr %
Goto checkiusr
: Edituser
Echo resets the "Start IIS process account" password to 123
Net user % useriwam % 123
Echo resets the "Internet Guest Account" password to 123
Net user % useriusr % 123
Echo password Synchronization
Cscript.exe % homedrive % \ Inetpub \ adminscripts \ adsutil. vbs set w3svc/wamuserpass 123
Cscript.exe % homedrive % \ Inetpub \ adminscripts \ adsutil. vbs set w3svc/anonymoususerpass 123
Echo *
Echo *
Set/P isok1 = Please test if IIS is normal? (Y/N)
If % isok1 % = y goto forend
Cscript.exe % homedrive % \ Inetpub \ adminscripts \ synciwam. vbs-V
Iisreset
Echo *
Echo *
Set/P isok2 = Please test if IIS is normal? (Y/N)
If % isok2 % = y goto forend
Echo clears information about the MSDTC Service Registry.
Reg Delete HKLM \ System \ CurrentControlSet \ Services \ MSDTC/F
Reg Delete HKLM \ Software \ Microsoft \ MSDTC/F
Reg Delete hkcr \ CID/F
Echo stops and reinstalls the MSDTC Service
Net stop MSDTC
MSDTC-uninstall
MSDTC-install
Echo resets the "Start IIS process account" and "Internet Guest Account" passwords
Net user % useriwam % 123
Net user % useriusr % 123
Echo: Synchronize the password of iwam_myserver in IIS metabase
% Homedrive % \ Inetpub \ adminscripts \ adsutil. vbs set w3svc/wamuserpass "123"
Echo: The iwam_myserver password used to synchronize COM + applications
Cscript.exe % homedrive % \ Inetpub \ adminscripts \ synciwam. vbs-V
Echo *
Echo *
Set/P isok3 = Please test if IIS is normal? (Y/N)
If % isok3 % = y goto forend
Echo re-register related components
Rundll32 % WINDIR % \ system32 \ inetsrv \ wamreg. dll, createiispackage
Regsvr32 % WINDIR % \ system32 \ inetsrv \ asptxn. dll/s
Echo *
Echo *
Set/P isok4 = Please test if IIS is normal? (Y/N)
If % isok4 % = y goto forend
Echo *
Echo *
Echo: If IIS is not normal, I can't solve it. Please try again!
: Forend
Echo *
Echo *
@ ECHO: the batch processing is complete. Please press any key to exit?
@ Echo off
Pause