@echo off
:: 请求管理员权限
if not "%1"=="am_admin" (
    powershell start -verb runas '%0' am_admin
    exit /b
)

:: 创建OEM文件夹
mkdir "C:\windows\system32\OEM" 2>nul
if not exist "C:\windows\system32\OEM" (
    echo 无法创建OEM文件夹,请检查权限
    pause
    exit /b
)

:: 查找U盘盘符并复制文件
set "fileFound="
for %%d in (D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
    if exist "%%d:\oem-cert.xrm-ms" (
        copy "%%d:\oem-cert.xrm-ms" "C:\windows\system32\OEM\" /y >nul
        set "fileFound=1"
        goto :fileCopied
    )
)

:fileCopied
if not defined fileFound (
    echo 未找到oem-cert.xrm-ms文件,请确保U盘已插入且文件存在
    pause
    exit /b
)

:: 执行slmgr命令
echo 正在安装OEM证书...
cscript //b %windir%\system32\slmgr.vbs -ilc C:\windows\system32\OEM\oem-cert.xrm-ms

echo 正在安装产品密钥...
cscript //b %windir%\system32\slmgr.vbs -ipk 74T2M-DKDBC-788W3-H689G-6P6GT

:: 重启电脑
echo 操作完成,准备重启计算机...
choice /t 30 /d y /c yn /n /m "30秒后计算机将自动重启,按Y立即重启,按N取消..."
if errorlevel 2 (
    echo 用户取消了重启
    pause
    exit /b
)
shutdown /r /t 0

阅读全文

在 Windows 10 下,即使不安装 Hyper-V 程序,其服务也开启了。这就造成使用 VMWare 安装 x64 的 Centos 时提示 CPU 未开启虚拟化,实际上已开启。我用过 bcdedit /set hypervisorlaunchtype off 命令想关闭 Hyper-V 服务但是无效。
请问有什么办法?

阅读全文