注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

往事如烟

科技创造价值

 
 
 

日志

 
 

Windows7部署过程中的个性化设置  

2013-04-20 13:41:19|  分类: Win系统制作 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

      一、Windows7系统封装与部署的命令入口
      1、system32\sysprep\sysprep.exe,运行这个程序执行系统封装。
      2、system32\oobe\windeploy.exe,系统进入系统部署模式后自动运行这个程序以完成系统部署中的各项功能。
      打开系统注册表“HKEY_LOCAL_MACHINE\SYSTEM\Setup”分支,里面有个键名位CmdLine,键值为“oobe\windeploy.exe”,这里就是系统部署命令的入口。我们可以修改它的入口实现部署过程中的一些个性化控制。
      例如我们把“oobe\windeploy.exe”修改为“oobe\deploy.cmd”,deploy.cmd文件放在windows\system32\oobe目录下面,其代码为:
@echo off     
start /wait %windir%\system32\oobe\windeploy.exe
net user Administrator /Active:yes
     
这样就实现了激活Administrator账户,这里激活Administrator账户的命令必须在部署控制命令之后,因为部署后系统会禁用Administrator账户。
      二、Windows7部署过程中的个性化设置
      window\system32\oobe\deploy.cmd的代码:
@echo off
::部署中调用驱动包,驱动包目录Drv放在$oem$\$目录中::
$if exist "%SystemDrive%\Driver\Drv.exe" (
   Start /wait %SystemDrive%\Driver\Drv.exe
)
::系统部署过程::
start /wait %windir%\system32\oobe\windeploy.exe
::激活Administrator账户::
net user Administrator /Active:yes
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v FilterAdministratorToken /t REG_DWORD /d 0 /f
::删除此cmd文件::
del %0

      三、首次登录时的个性化设置

      1 、 无人值守安装配置文件$OEM$\$$\Panther\unattend.xml代码:
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="specialize">
        <component name="Microsoft-Windows-Deployment" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="
http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <RunSynchronous>
                <RunSynchronousCommand wcm:action="add">
                    <Description>EnableAdmin</Description>
                    <Order>1</Order>
                    <Path>%windir%\Setup\Scripts\Admin.cmd</Path>
                </RunSynchronousCommand>
            </RunSynchronous>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="
http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <FirstLogonCommands>
                <SynchronousCommand wcm:action="add">
                    <CommandLine>%windir%\Setup\Scripts\Oem.cmd</CommandLine>
                    <Description>Modify</Description>
                    <Order>1</Order>
                    <RequiresUserInput>false</RequiresUserInput>
                </SynchronousCommand>
            </FirstLogonCommands>
             <OOBE>
                <HideEULAPage>true</HideEULAPage>
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                <NetworkLocation>Work</NetworkLocation>
                <ProtectYourPC>2</ProtectYourPC>
                <SkipMachineOOBE>true</SkipMachineOOBE>
                <SkipUserOOBE>true</SkipUserOOBE>
            </OOBE>
            <VisualEffects>
                <FontSmoothing>ClearType</FontSmoothing>
            </VisualEffects>
            <RegisteredOrganization>MS</RegisteredOrganization>
            <RegisteredOwner>USER-</RegisteredOwner>
            <BluetoothTaskbarIconEnabled>true</BluetoothTaskbarIconEnabled>
            <DisableAutoDaylightTimeSet>true</DisableAutoDaylightTimeSet>
            <DoNotCleanTaskBar>false</DoNotCleanTaskBar>
            <ShowWindowsLive>false</ShowWindowsLive>
            <StartPanelOff>false</StartPanelOff>
            <TimeZone>China Standard Time</TimeZone>
        </component>
        <component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="
http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <InputLocale>0804:00000804</InputLocale>
            <SystemLocale>zh-CN</SystemLocale>
            <UILanguage>zh-CN</UILanguage>
            <UILanguageFallback>zh-CN</UILanguageFallback>
            <UserLocale>zh-CN</UserLocale>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:k:/sources/install.wim#Windows 7 ULTIMATE" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

      2、激活Administrator账户$OEM$\$$\Setup\Scripts\Admin.cmd代码:
@Echo Off
net user Administrator /active:yes
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v FilterAdministratorToken /t REG_DWORD /d 0 /f
del /f %0

      3、个性化设置$OEM$\$$\Setup\Scripts\Oem.cmd代码:
@Echo Off
start /wait regedit /s %windir%\Setup\Scripts\Oem.reg >nul
del /f /q /s %windir%\Setup\Oem.reg >nul
del /f %0

      个性化设置$OEM$\$$\Setup\Scripts\Oem.reg代码:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]
;首次进入桌面运行程序Login.cmd
"login"=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,53,00,65,\
00,74,00,75,00,70,00,5c,00,4c,00,6f,00,67,00,69,00,6e,00,2e,00,63,00,6d,00,\
64,00,00,00

;添加“设备管理器”到"计算机"右键菜单
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\Devices]
@=hex(2):be,8b,07,59,a1,7b,06,74,68,56,00,00

[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\Devices\command]
@=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,73,00,79,00,73,\
  00,74,00,65,00,6d,00,33,00,32,00,5c,00,6d,00,6d,00,63,00,2e,00,65,00,78,00,\
  65,00,20,00,2f,00,73,00,20,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,\
  00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,\
  32,00,5c,00,64,00,65,00,76,00,6d,00,67,00,6d,00,74,00,2e,00,6d,00,73,00,63,\
  00,20,00,2f,00,73,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center]
;关闭UAC通知
"UacDisableNotify"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Power]
;关闭休眠
"HibernateEnable"=dword:00000000

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
;在桌面上显示个人文件夹图标
"{59031a47-3f72-44a7-89c5-5595fe6b30ee}"=dword:00000000
;在桌面上显示计算机图标
"{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000
;在桌面上显示网络图标
"{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}"=dword:00000000

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
;始终显示系统托盘图标
"EnableAutoTray"=dword:00000000
;不添加“快捷方式”后缀
"link"=hex:00,00,00,00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
;从不合并任务栏按钮
"TaskbarGlomLevel"=dword:00000002
;开始菜单显示“运行”栏
"Start_ShowRun"=dword:00000001
;资源管理显示经典菜单
"AlwaysShowMenus"=dword:00000001
;显示已知文件类型的扩展名
"HideFileExt"=dword:00000000

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel]
;控制面板显示经典大图标
"AllItemsIconView"=dword:00000000
"StartupPage"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MAIN]
;设置IE主页为"http://www.hao123.com/"
"Start Page"="http://www.hao123.com/"
"Default_Page_URL"="http://www.hao123.com/"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MINIE]
;显示IE菜单栏
"AlwaysShowMenus"=dword:00000001
;显示链接栏
"LinksBandEnabled"=dword:00000001
;单独一行显示地址栏
"ShowTabsBelowAddressBar"=dword:00000001
;显示状态栏
"ShowStatusBar"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TabbedBrowsing]
;在当前窗口中的新选项卡
"NewTabPageShow"=dword:00000001
;始终在新选项卡中打开弹出窗口
"PopupsUseNewWindow"=dword:00000002

;在Win7桌面上显示IE图标 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{00000000-0000-0000-0000-100000000001}]
@="Internet Explorer"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}]
@="Internet Explorer"
"InfoTip"="@C:\\Windows\\System32\\ieframe.dll,-881"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\DefaultIcon]
@="C:\\Windows\\System32\\ieframe.dll,-190"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\Shell]
@=""

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\Shell\Alank]
@="打开空白页(&B)"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\Shell\Alank\Command]
@="\"C:\\Program Files\\Internet Explorer\\iexplore.exe\" about:blank"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\Shell\Clean]
@="删除历史记录(&C)"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\Shell\Clean\Command]
@="\"C:\\Windows\\System32\\rundll32.exe\" InetCpl.cpl,ClearMyTracksByProcess 255"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\Shell\InPrivate]
@="开始InPrivate浏览(&I)"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\Shell\InPrivate\Command]
@="\"C:\\Program Files\\Internet Explorer\\iexplore.exe\" -private"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\Shell\NoAddOns]
@="无加载项启动(&N)"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\Shell\NoAddOns\Command]
@="\"C:\\Program Files\\Internet Explorer\\iexplore.exe\" about:NoAdd-ons"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\Shell\Open]
@="打开主页(&H)"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\Shell\Open\Command]
@="\"C:\\Program Files\\Internet Explorer\\iexplore.exe\""

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\Shell\Properties]
@="属性(&R)"

[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\Shell\Properties\Command]
@="\"C:\\Windows\\System32\\rundll32.exe\" C:\\Windows\\System32\\shell32.dll,Control_RunDLL C:\\Windows\\System32\\inetcpl.cpl"

      首次进入桌面运行程序\$OEM$\$$\Setup\Login.cmd代码:
@Echo Off
::清理安装过程的临时文件::
IF EXIST "%windir%\Setup\Scripts" (
attrib -R -A -S -H %windir%\Setup\Scripts\*.* >nul
rd /q /s %windir%\Setup\Scripts >nul
)
::清理unattend.xml文件::
IF EXIST "%windir%\Panther\unattend.xml" (
attrib -R -A -S -H %windir%\Panther\unattend.xml >nul
del /q /f %windir%\Panther\unattend.xml >nul
)
::运行驱动程序包::
IF EXIST "%SystemDrive%\Driver\Drv.exe" (
   start %SystemDrive%\Driver\Drv.exe
)
del /f %0

  评论这张
 
阅读(32896)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017