|
在必应上搜索到了:命令加配置文件添加删除输入法、复制当前用户输入法设置到新用户
解决了执行全新oobe后,之前安装的输入法不见了和输入法栏固定在任务栏上的问题
以此作记录
Windows Vista Command Line Configuration of International Settings
(Windows Vista命令行配置国际设置)
https://msdn.microsoft.com/en-ie/goglobal/bb964650(en-us).aspx
-----------------------------------------------------------------------------------
control intl.cpl,,/f:"DefaultInput.xml" DefaultInput.xml要写绝对路径
将配置文件DefaultInput.xml中的内容传递到键盘和语言设置面板
control intl.cpl,,/f:"DefaultInput.xml" 可在正在运行的系统中执行,也可用于应答文件中
control intl.cpl,,/f:"DefaultInput.xml" 也可写成rundll32.exe shell32,Control_RunDLL intl.cpl,,/f:"DefaultInput.xml"
-----------------------------------------------------------------------------------
DefaultInput.xml内容如下:
<?xml version="1.0" encoding="utf-8"?>
<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<!--User List-->
<gs:UserList>
<gs:User UserID="Current" CopySettingsToDefaultUserAcct="true"/>
CopySettingsToDefaultUserAcct="true"复制到新用户,输入法栏会固定在任务栏上
如果里面增加CopySettingsToSystemAcct =“true”,则会复制到“欢迎”屏幕
比如:<gs:User UserID="Current" CopySettingsToDefaultUserAcct="true" CopySettingsToSystemAcct =“true” />
</gs:UserList>
<!--input preferences-->
<gs:InputPreferences>
<!--add jd keyboard-->
<gs:InputLanguageID Action="add" ID="0804:e0010804" Default="true"/>
添加极点输入法并将极点输入法设置为默认输入法
0804:e0010804是语言ID和极点输入法的键盘ID
</gs:InputPreferences>
</gs:GlobalizationServices>
-----------------------------------------------------------------------------------
应答文件内容如下:
<?xml version='1.0' encoding='utf-8'?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<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">
<Order>1</Order>
<CommandLine>control intl.cpl,,/f:"C:\Windows\Panther\DefaultInput.xml"</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
</component>
</settings>
</unattend>
环境:win7旗舰sp1 32位 在同一台电脑情况下
小技巧
有时需要多次封装测试,提前做好准备,减少麻烦:
1、执行全新oobe前将C:\Windows\System32\config下注册表配置单元system拷贝一份,当出现某些错误时,进入pe将system备份覆盖C:\Windows\System32\config中的System
2、保留硬件配置应答文件
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component name="Microsoft-Windows-PnpSysprep" 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">
<DoNotCleanUpNonPresentDevices>true</DoNotCleanUpNonPresentDevices>
<PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
</component>
</settings>
</unattend>
安装过程中,安装设备阶段花的时间最长,执行全新oobe用了保留硬件配置应答文件,安装设备阶段极大缩短所需时间:
安装程序正在更新注册表设置-安装程序正在启动服务-安装程序正在安装设备(其实没安装)-安装程序正在正在应用系统配置-安装程序将在重新启动您的计算机后继续
3、处理完某个配置阶段后,Windows 安装程序将对缓存的应答文件添加注释,以表明该阶段已处理。
如果应答文件某一项被执行后,比如<settings pass="*">被执行了,就会变成<settings pass="*" wasPassProcessed="true">
所以某一项中有wasPassProcessed="true",就表示被执行了,系统不会再执行它,你可把wasPassProcessed="true"删掉,系统又会执行它
当然,Windows 安装程序将对缓存的应答文件添加的注释更多或修改了其它一些地方,比如应答文件中的用户密码和系统密钥等
注意:如果处在审核模式下,如果C:\Windows\Panther中有可用于auditsystem或audituser的应答文件,重启电脑时会执行应答文件,即没用命令指定应答文件也会执行
应答文件
应答文件中使用命令
同步命令RunSynchronous\RunSynchronousCommand
下面的组件中有同步命令,只能配置到4、6阶段 (4 specialize, 6 auditUser)
x86_Microsoft-Windows-Deployment_6.1.7601.17514_neutral/RunSynchronous
x86_Microsoft-Windows-Deployment_6.1.7601.17514_neutral/RunSynchronous/RunSynchronousCommand
下面的组件中有同步命令,只能配置到1阶段 (1 windowsPE)
x86_Microsoft-Windows-Setup_6.1.7600.16385_neutral/RunSynchronous
x86_Microsoft-Windows-Setup_6.1.7600.16385_neutral/RunSynchronous/RunSynchronousCommand
异步命令RunAsynchronous\RunAsSynchronousCommand
下面的组件中有异步命令,只能配置到4、6阶段 (4 specialize, 6 auditUser)
x86_Microsoft-Windows-Deployment_6.1.7601.17514_neutral/RunAsynchronous
x86_Microsoft-Windows-Deployment_6.1.7601.17514_neutral/RunAsynchronous/RunAsynchronousCommand
下面的组件中有异步命令,只能配置到1阶段 (1 windowsPE)
x86_Microsoft-Windows-Setup_6.1.7600.16385_neutral/RunAsynchronous
x86_Microsoft-Windows-Setup_6.1.7600.16385_neutral/RunAsynchronous/RunAsynchronousCommand
同步命令FirstLogonCommands/SynchronousCommand
下面的组件中有同步命令,只能配置到7阶段 (7 oobeSystem)
x86_Microsoft-Windows-Shell-Setup_6.1.7601.17514_neutral/FirstLogonCommands
x86_Microsoft-Windows-Shell-Setup_6.1.7601.17514_neutral/FirstLogonCommands/SynchronousCommand
异步命令FirstLogonCommands/SynchronousCommand
下面的组件中有异步命令,只能配置到7阶段 (7 oobeSystem)
x86_Microsoft-Windows-Shell-Setup_6.1.7601.17514_neutral/LogonCommands
x86_Microsoft-Windows-Shell-Setup_6.1.7601.17514_neutral/LogonCommands/AsynchronousCommand令
应答文件单项测试
拷贝用户配置文件
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<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">
<CopyProfile>true</CopyProfile>
</component>
</settings>
</unattend>
审核模式重启把用户从users组删除应答文件
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="auditUser">
<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">
<RunAsynchronous>
<RunAsynchronousCommand wcm:action="add">
<Path>net LOCALGROUP users new /delete</Path>
<Description>Remove users from LOCALGROUP</Description>
<Order>1</Order>
</RunAsynchronousCommand>
</RunAsynchronous>
</component>
</settings>
</unattend
|
|