|  | 
| 不需要强制重启,以下是论坛高手写的多系统重启直进 
 
 复制代码@echo off
:: 检查是否以管理员身份运行
net session >nul 2>&1
if %errorLevel% neq 0 (
    echo 请以管理员身份运行此脚本。
    echo 正在尝试以管理员身份重新运行...
    :: 重新以管理员身份运行
    powershell -Command "Start-Process '%~f0' -Verb RunAs"
    exit
)
:: 如果已是管理员权限,则执行以下命令
setlocal enabledelayedexpansion
REM 初始化变量
set index=1
REM 获取系统引导配置列表
for /f "tokens=1,2,* delims= " %%A in ('bcdedit /enum ^| findstr "identifier description"') do (
    if /i "%%A"=="identifier" (
        REM 存储每个操作系统的标识符
        set id!index!=%%B
    ) else if /i "%%A"=="description" (
        REM 存储每个操作系统的描述
        set description=%%C
        REM 如果描述前缀为 "Windows",我们直接显示它
        REM 如果没有 "Windows" 前缀,就手动添加
        if /i "!description:~0,8!"=="Windows " (
            echo !index!: !description!
        ) else (
            echo !index!: Windows !description!
        )
        set /a index+=1
    )
)
REM 提示用户选择系统
set /p choice=请选择要启动的系统对应的数字(例如1, 2, 3...):
REM 验证输入是否为有效数字
if not defined id%choice% (
    echo 输入无效,请重试。
    pause
    exit /b
)
REM 设置一次性启动项
bcdedit /bootsequence !id%choice%!
REM 重启系统
shutdown /r /t 0
 | 
 |