一早起来上论坛,看到个帖子:
windows xp sp2一到登录界面就重启
http://forums.microsoft.com/china/ShowPost.aspx?PostID=2664909&SiteID=15
输入用户名密码那个界面闪一下就自动重启了,
是怎么回事,
进安全模式也一样
谢谢
本来想跟帖回答的,不过后来觉得这问题还是值得一说,就干脆写得详细一点吧。
1.什么是Userinit.exe
如果有《Windows Internals》的可以参考P272页的解释:
Winlogon next tells the GINA to start the shell. In response to this request, Msgina launches the executable or executables specified in HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Userinit (with multiple executables separated by commas) that by default points at \Windows\System32\Userinit.exe. Userinit.exe performs the following steps:
-
Processes the user scripts specified in HKCU\Software\Policies\Microsoft\Windows\System\Scripts and the machine logon scripts in HKLM\Software\Policies\Microsoft\Windows\System\Scripts. (Because machine scripts run after user scripts, they can override user settings.)
-
If group policy specifies a user profile quota, starts \Windows\System32\Proquota.exe to enforce the quota for the current user.
-
Launches the comma-separated shell or shells specified in HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell. If that value doesn't exist, Userinit.exe launches the shell or shell specified in HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell, which is by default Explorer.exe.
Winlogon then notifies registered network providers that a user has logged in. The Microsoft network provider, Multiple Provider Router (\Windows\System32\Mpr.dll), restores the user's persistent drive letter and printer mappings stored in HCU\Network and HKCU\ Printers, respectively. Figure 5-3 shows the process tree as seen in Process Explorer during a login before Userinit has exited.
如果觉得看E文麻烦,我这边有一张PPT也可以解释
2.说说Asuka自己遇到Userinit的经历
中国有句古话叫不打不相识。
一年前,我差不多还不知道盆盆和ITECN,当然那个时候自己最多就看看菜鸟杂志,掌握点小技巧之类的。
一次,我去我堂妹那边玩,她家那台电脑号称是买好电脑后没有重新装过系统,然后要我帮忙重装,我手上没有盘,也嫌麻烦,就答应帮他优化一下(嘿嘿,随便忽悠一下),下了个瑞星的卡卡助手,首当其冲的就是要优化启动程序。其实我平时自己看启动程序无非就是用msconfig或者Windows Defender,Sysinternals的Autorun都很少需要登场,那次在妹妹这边也是看到卡卡助手也有类似功能,就选择用卡卡助手查看启动项,一看到小妹电脑里面有很多的不明启动项,马上进行优化,一优化出问题了。
重启后,我本来得意的认为这下电脑的启动速度可是加到快速档了,没想到输入好用户名密码就开始重启,后来任凭我怎么搞都没法子。
这下讨厌了。
3.一般解决方法和高级解决方法
一般方法:WinPE
一般方法其实很简单很简单,如果手上有一张ERD或者深山红叶类似基于Winpe的光盘,那么直接杀进系统,到注册表的这个位置:
HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon
找到Userinit,然后把键值设置为C:\Windows\System32\Userinit.exe
即可
如果用这个方法,估计1分钟不到就能够解决问题,我当时也是这么解决的
其实也可以在故障恢复控制台这么做
高级方法1:故障恢复控制台
说到高级方法我要引用盆盆《XP一点通》P148上面“开机时提示C:\windows\system32\config\system文件损坏”一文中所用到的方法,这一招就是利用了几个注册表的配置文件来解决问题的
第一步:登录“故障恢复控制台”,输入:
md regback
cd system32
cd config
copy default \windows\regback\
copy sam \windows\regback\
copy security \windows\regback\
copy software \windows\regback\
copy system \windows\regback\
del default
del sam
del security
del software
del system
copy \windows\repair\default
copy \windows\repair\sam
copy \windows\repair\security
copy \windows\repair\software
copy \windows\repair\system
exit
第二步:重启进入系统(此时的系统注册表被恢复成新装时的状态),选中[HKEY_LOCAL_MACHINE]分支,选择菜单“文件→加载配置单元”,打开刚才保存的c:\windows\regback\software文件,设定任意名称(如reg),在该项下按本文开头给出的正确值恢复Userinit值,完成后选中刚才加载的reg项,选择菜单“文件 →卸载配置单元”。
第三步:重启再次进入“故障控制控制台”,键入下列代码:
cd system32
cd config
del default
del sam
del security
del software
del system
copy \windows\regback\default
copy \windows\regback\sam
copy \windows\regback\security
copy \windows\regback\software
copy \windows\regback\system
exit
高级方法2:网络注册表
如果此时环境中还有其他计算机在一个工作组或者同一个Domain中,可以通过加载注册表的方式
假设出问题的计算机叫“Redmond”,此时"Redmond"到了输入用户名和个密码的对话框,打住
同时打开来到同一个工作组中另外一个计算机的注册表,文件->打开网络注册表

4.还要注意一下Userinit.exe文件如果被破坏了的话
进入“故障恢复控制台”
cd system32
expand 光盘:\i386\userinit.ex_
exit
5.总结
很简单的一个小问题却可以找到很多的解决方法引出很多的知识,比如Windows的启动过程、故障恢复控制台、WinPE,如果想体验一下这个实验的乐趣,也很简单,在虚拟机里面就可以实现,花个1个小时,把上面的步骤都跟做一遍,就可以掌握了。
很多东西,只有自己做了才能够感受得到和更深层次的学好。
有问题的话,如果关于文章有任何问题都可以给我写邮件:
page333###gmail.com