mirror of
https://github.com/bin456789/reinstall.git
synced 2026-05-21 05:27:41 +08:00
windows: 支持使用非 administrator 账号
This commit is contained in:
17
windows.xml
17
windows.xml
@ -86,7 +86,7 @@
|
||||
<Order>4</Order>
|
||||
<Path>powercfg /setactive SCHEME_MIN</Path>
|
||||
</RunSynchronousCommand>
|
||||
<!-- 启用 administrator 账户 -->
|
||||
<!-- 按需启用 administrator 账户 -->
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Order>5</Order>
|
||||
<!-- vista 没有自带 powershell -->
|
||||
@ -94,7 +94,8 @@
|
||||
<!-- win7 此时无法用 wmic useraccount -->
|
||||
<!-- <Path>wmic useraccount where "sid like '%-500'" set Disabled=false</Path> -->
|
||||
<!-- https://learn.microsoft.com/archive/technet-wiki/13813.localized-names-for-administrator-account-in-windows -->
|
||||
<Path>cmd /c "for %a in (Administrator Administrador Administrateur Administratör Администратор Järjestelmänvalvoja Rendszergazda) do (net user %a /active:yes && exit)"</Path>
|
||||
<!-- %enable_administrator% 会被 trans.sh 替换成 1 或 0 -->
|
||||
<Path>cmd /c "if "%enable_administrator%"=="1" for %a in (Administrator Administrador Administrateur Administratör Администратор Järjestelmänvalvoja Rendszergazda) do (net user %a /active:yes && exit)"</Path>
|
||||
</RunSynchronousCommand>
|
||||
<!-- 禁用保留空间 -->
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
@ -152,6 +153,18 @@
|
||||
<Value>%administrator_password%</Value>
|
||||
<PlainText>false</PlainText>
|
||||
</AdministratorPassword>
|
||||
<LocalAccounts>
|
||||
<LocalAccount wcm:action="add">
|
||||
<Name>%user_username%</Name>
|
||||
<Password>
|
||||
<Value>%user_password%</Value>
|
||||
<PlainText>false</PlainText>
|
||||
</Password>
|
||||
<!-- 需要填英文的 Administrators,任何语言都是 -->
|
||||
<!-- https://learn.microsoft.com/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-useraccounts-localaccounts-localaccount-group -->
|
||||
<Group>Administrators</Group>
|
||||
</LocalAccount>
|
||||
</LocalAccounts>
|
||||
</UserAccounts>
|
||||
<OOBE>
|
||||
<HideEULAPage>true</HideEULAPage>
|
||||
|
||||
Reference in New Issue
Block a user