找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
楼主: hfut

[原创] 【最小安装器】WindowsSetup脚本

    [复制链接]
发表于 2025-10-30 08:28:49 | 显示全部楼层
感谢分享!
回复

使用道具 举报

发表于 2025-11-5 23:03:09 | 显示全部楼层
chcp 65001 | rem
UTF8 格式的文本
回复

使用道具 举报

发表于 2025-11-6 10:32:36 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2025-11-6 11:31:43 | 显示全部楼层
谢谢您的分享!
回复

使用道具 举报

发表于 2025-11-6 16:00:58 | 显示全部楼层
感谢分享!
回复

使用道具 举报

发表于 2025-11-8 10:51:37 | 显示全部楼层
感谢大佬分享!
回复

使用道具 举报

发表于 2025-11-8 18:42:02 | 显示全部楼层
518hl 发表于 2025-10-23 20:45
编码要注意下  

utf-8 不行  有乱码

utf-8 带bom就可以
回复

使用道具 举报

发表于 2025-11-10 09:37:43 | 显示全部楼层
学习学习
回复

使用道具 举报

发表于 2025-11-10 10:51:21 | 显示全部楼层
可以直接上传个附件吗?这样复制感觉很容易出错。
回复

使用道具 举报

发表于 2025-11-11 18:20:55 | 显示全部楼层
感谢分享
回复

使用道具 举报

发表于 2025-11-12 15:42:23 | 显示全部楼层
这个支持下
回复

使用道具 举报

发表于 2025-11-15 21:36:20 | 显示全部楼层
大牛的作品呀!
回复

使用道具 举报

发表于 2025-11-17 17:35:16 | 显示全部楼层
牛人,就差一个怎么分区。
回复

使用道具 举报

发表于 2025-12-1 18:00:08 | 显示全部楼层
感谢分享,收藏了
回复

使用道具 举报

发表于 2026-3-17 20:33:55 | 显示全部楼层
谢谢分享..
回复

使用道具 举报

发表于 7 天前 | 显示全部楼层
感谢分享!
回复

使用道具 举报

发表于 7 天前 | 显示全部楼层
多谢,刚好用得上。
回复

使用道具 举报

发表于 6 天前 来自手机 | 显示全部楼层
这脚本真厉害,楼主给力
回复

使用道具 举报

发表于 6 天前 | 显示全部楼层
这个强大啊,谢谢

评分

参与人数 1无忧币 +1 收起 理由
yyz2191958 + 1

查看全部评分

回复

使用道具 举报

发表于 6 天前 | 显示全部楼层
个人自用的如下:

@echo off
setlocal enabledelayedexpansion

:: 检查是否传入了参数
if "%~1"=="" (
    echo 请传入一个文件名作为参数。
    exit /b 1
)

::显示映像目录
dism /Get-WimInfo /WimFile:%1

::让用户输入索引号
if "%index%"=="" set /p index="请输入要安装的镜像索引号:" || set "index=1"

::检查c盘是否正确
if exist "C:\Windows" (
    format c: /q /y /V:系统
) else (
    format c: /q /V:系统

)

:: 释放映像到c盘
dism /Apply-Image /ImageFile:%1 /Index:%index% /ApplyDir:c:
:: wimlib-imagex apply %1 %index% c:

:: 判断文件名是否包含 "install",那通常是微软弄的安装镜像
echo %1 | findstr /i "install" >nul
if %errorlevel% == 0 (
    ::新建应答文件夹
    md C:\Windows\Panther
    ::复制自动化安装和配置应答文件
    copy %~dp0\unattend.xml C:\Windows\Panther\unattend.xml
  
)

:: 判断影像号码如果大于1,那通常是微软弄的安装镜像
if not %index% == 1 (
    ::新建应答文件夹
    md C:\Windows\Panther
    ::复制自动化安装和配置应答文件
    copy %~dp0\unattend.xml C:\Windows\Panther\unattend.xml

)

:: 加载esp分区
mountvol s: /s

:: 格式化esp分区
format s: /q /y

:: 安装uefi引导
bcdboot c:\windows /l zh-cn /s s: /f uefi
bootsect /nt60 s:

::重启
wpeutil reboot

endlocal
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1|闽公网安备35020302032614号 )

GMT+8, 2026-4-29 15:49

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表