windows: 修复了切换到 65001 代码页后,安装 win7 卡在 diskpart 界面

This commit is contained in:
bin456789 2024-03-22 00:50:46 +08:00
parent 7d02eebfd5
commit e3fe839329
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B
2 changed files with 9 additions and 3 deletions

View File

@ -30,7 +30,7 @@ if defined mac_addr (
rem 配置静态 IPv4 DNS 服务器
for %%i in (1, 2) do (
if defined ipv4_dns%%i (
netsh interface ipv4 add | find "dnsservers"
netsh interface ipv4 add | findstr "dnsservers"
if ErrorLevel 1 (
rem vista
netsh interface ipv4 add dnsserver !id! !ipv4_dns%%i! %%i
@ -50,7 +50,7 @@ if defined mac_addr (
rem 配置 IPv6 DNS 服务器
for %%i in (1, 2) do (
if defined ipv6_dns%%i (
netsh interface ipv6 add | find "dnsservers"
netsh interface ipv6 add | findstr "dnsservers"
if ErrorLevel 1 (
rem vista
netsh interface ipv6 add dnsserver !id! !ipv6_dns%%i! %%i

View File

@ -1,5 +1,11 @@
@echo off
mode con cp select=65001 >nul
mode con cp select=437 >nul
rem 正常来说应该用 46001 代码页
rem 但 win7 find 命令在 46001 代码页下有问题,仅限 win 7
rem echo a | find "a"
rem findstr 就正常,但安装程序又没有 findstr
rem 只好用 437 代码页,好像也没副作用
rem 使用高性能模式
rem https://learn.microsoft.com/windows-hardware/manufacture/desktop/capture-and-apply-windows-using-a-single-wim