IT天空

 找回密码
 加入我们

手机号码,快捷登录

搜索

[求助] 这2个批处理怎么合并在一起SetupComplete.cmd

[复制链接]
前面是绝路希 发表于 2021-11-12 12:22:34 | 显示全部楼层 |阅读模式

IT天空 定制版高速U盘 128G | 固态U盘 256G Pro/512G Pro
这2个批处理怎么合并在一起SetupComplete.cmd @echo offecho. & echo * 驱动安装正在进行(请勿关闭本窗口) *IF EXIST "%SystemRoot%\WanDrv\WanDrv.exe" (start /wait %SystemRoot%\WanDrv\WanDrv.exe /FA)clsIF EXIST "%SystemRoot%\WanDrv" (rd /f /q %SystemRoot%\WanDrv)clsIF EXIST "%systemdrive%\Drivers" (rd /q /s %systemdrive%\Drivers)clsrd /s /q %Windir%\Setup\Scripts 1>nul 2>nuldel%0-----------------------------------------------------------------分割线上面1下面2@echo offIF EXIST C:\SWTOOLS RD /Q /S C:\SWTOOLSIF EXIST "%Systemroot%\Setup\OEMFILES" RD /Q /S %Systemroot%\Setup\OEMFILESIF EXIST "%Systemroot%\Setup\AIDA64" RD /Q /S %Systemroot%\Setup\AIDA64IF EXIST "%SYSTEMDRIVE%\AIDA64 REPORTS" RD /Q /S "%SYSTEMDRIVE%\AIDA64 REPORTS"IF EXIST "%SYSTEMDRIVE%\DRV64" RD /Q /S "%SYSTEMDRIVE%\DRV64"IF EXIST "%SYSTEMDRIVE%\DRV32" RD /Q /S "%SYSTEMDRIVE%\DRV32"IF EXIST "%SYSTEMDRIVE%\DRV" RD /Q /S "%SYSTEMDRIVE%\DRV"IF EXIST "%WINDIR%\System32\DepX64.exe" del /f /q "%WINDIR%\System32\DepX64.exe"IF EXIST "%WINDIR%\System32\DepX86.exe" del /f /q "%WINDIR%\System32\DepX86.exe"START /WAIT /B cscript /logo %Systemroot%\system32\slmgr.vbs -xpr | findstr /I "计算机已永久激活" && GOTO ENDALLSTART /WAIT /B cscript /logo %SYSTEMROOT%\system32\slmgr.vbs -xpr | findstr /I "The machine is permanently activated" && GOTO ENDALLWMIC PARTITION | findstr /i "GPT"IF NOT ERRORLEVEL 1 GOTO GPT%~dp0"Windows Loader.exe" /silent /preactivatecd %~dp0attrib -R -A -S -H *.*SHUTDOWN /R /T 6RMDIR /S /Q "%WINDIR%\Setup\Scripts"exit:GPTSTART /WAIT /MIN %~dp0"efi.cmd"cd %~dp0attrib -R -A -S -H *.*SHUTDOWN /R /T 6RMDIR /S /Q "%WINDIR%\Setup\Scripts"exit:ENDALLcd %~dp0attrib -R -A -S -H *.*RMDIR /S /Q "%WINDIR%\Setup\Scripts"exit合并在一起保存为SetupComplete.cmd
最近访问 头像模式 列表模式
浅暮丶千殇 发表于 2021-11-12 21:26:21 | 显示全部楼层

活跃 1919| 技术 0| 互助 0| 钻石 0

大哥  命令做下排版啊

点评

怎么排的  详情 回复 发表于 2021-11-12 22:43
yakeyun 发表于 2021-11-12 21:31:48 | 显示全部楼层

活跃 91| 技术 0| 互助 0| 钻石 0

@echo off cd %~dp0 title 驱动安装中... echo. & echo * 驱动安装正在进行(请勿关闭本窗口) * IF EXIST "%SystemRoot%\WanDrv\WanDrv.exe" (start /wait %SystemRoot%\WanDrv\WanDrv.exe /FA) cls IF EXIST "%SystemRoot%\WanDrv" (rd /f /q %SystemRoot%\WanDrv) cls IF EXIST "%systemdrive%\Drivers" (rd /q /s %systemdrive%\Drivers)clsrd /s /q %Windir%\Setup\Scripts 1>nul 2>nul cls title 系统优化中... IF EXIST C:\SWTOOLS RD /Q /S C:\SWTOOLS IF EXIST "%Systemroot%\Setup\OEMFILES" RD /Q /S %Systemroot%\Setup\OEMFILES IF EXIST "%Systemroot%\Setup\AIDA64" RD /Q /S %Systemroot%\Setup\AIDA64 IF EXIST "%SYSTEMDRIVE%\AIDA64 REPORTS" RD /Q /S "%SYSTEMDRIVE%\AIDA64 REPORTS" IF EXIST "%SYSTEMDRIVE%\DRV64" RD /Q /S "%SYSTEMDRIVE%\DRV64" IF EXIST "%SYSTEMDRIVE%\DRV32" RD /Q /S "%SYSTEMDRIVE%\DRV32" IF EXIST "%SYSTEMDRIVE%\DRV" RD /Q /S "%SYSTEMDRIVE%\DRV" IF EXIST "%WINDIR%\System32\DepX64.exe" del /f /q "%WINDIR%\System32\DepX64.exe" IF EXIST "%WINDIR%\System32\DepX86.exe" del /f /q "%WINDIR%\System32\DepX86.exe" START /WAIT /B cscript /logo %Systemroot%\system32\slmgr.vbs -xpr | findstr /I "计算机已永久激活" && GOTO ENDALL START /WAIT /B cscript /logo %SYSTEMROOT%\system32\slmgr.vbs -xpr | findstr /I "The machine is permanently activated" && GOTO ENDALL WMIC PARTITION | findstr /i "GPT" IF NOT ERRORLEVEL 1 GOTO GPT %~dp0"Windows Loader.exe" /silent /preactivatecd  %~dp0attrib -R -A -S -H *.*SHUTDOWN /R /T 6 RMDIR /S /Q "%WINDIR%\Setup\Scripts"exit :GPT START /WAIT /MIN %~dp0"efi.cmd" cd %~dp0attrib -R -A -S -H *.*SHUTDOWN /R /T 6 RMDIR /S /Q "%WINDIR%\Setup\Scripts" exit :ENDALL cd %~dp0 attrib -R -A -S -H *.* RMDIR /S /Q "%WINDIR%\Setup\Scripts" exit  保存为SetupComplete.cmd
yakeyun 发表于 2021-11-12 21:32:36 | 显示全部楼层

活跃 91| 技术 0| 互助 0| 钻石 0

@echo off
cd %~dp0
title 驱动安装中...
echo. & echo * 驱动安装正在进行(请勿关闭本窗口) *
IF EXIST "%SystemRoot%\WanDrv\WanDrv.exe" (start /wait %SystemRoot%\WanDrv\WanDrv.exe /FA)
cls
IF EXIST "%SystemRoot%\WanDrv" (rd /f /q %SystemRoot%\WanDrv)
cls
IF EXIST "%systemdrive%\Drivers" (rd /q /s %systemdrive%\Drivers)clsrd /s /q %Windir%\Setup\Scripts 1>nul 2>nul
cls
title 系统优化中...
IF EXIST C:\SWTOOLS RD /Q /S C:\SWTOOLS
IF EXIST "%Systemroot%\Setup\OEMFILES" RD /Q /S %Systemroot%\Setup\OEMFILES
IF EXIST "%Systemroot%\Setup\AIDA64" RD /Q /S %Systemroot%\Setup\AIDA64
IF EXIST "%SYSTEMDRIVE%\AIDA64 REPORTS" RD /Q /S "%SYSTEMDRIVE%\AIDA64 REPORTS"
IF EXIST "%SYSTEMDRIVE%\DRV64" RD /Q /S "%SYSTEMDRIVE%\DRV64"
IF EXIST "%SYSTEMDRIVE%\DRV32" RD /Q /S "%SYSTEMDRIVE%\DRV32"
IF EXIST "%SYSTEMDRIVE%\DRV" RD /Q /S "%SYSTEMDRIVE%\DRV"
IF EXIST "%WINDIR%\System32\DepX64.exe" del /f /q "%WINDIR%\System32\DepX64.exe"
IF EXIST "%WINDIR%\System32\DepX86.exe" del /f /q "%WINDIR%\System32\DepX86.exe"
START /WAIT /B cscript /logo %Systemroot%\system32\slmgr.vbs -xpr | findstr /I "计算机已永久激活" && GOTO ENDALL
START /WAIT /B cscript /logo %SYSTEMROOT%\system32\slmgr.vbs -xpr | findstr /I "The machine is permanently activated" && GOTO ENDALL
WMIC PARTITION | findstr /i "GPT"
IF NOT ERRORLEVEL 1 GOTO GPT
%~dp0"Windows Loader.exe" /silent /preactivatecd
%~dp0attrib -R -A -S -H *.*SHUTDOWN /R /T 6
RMDIR /S /Q "%WINDIR%\Setup\Scripts"exit
:GPT
START /WAIT /MIN %~dp0"efi.cmd"
cd %~dp0attrib -R -A -S -H *.*SHUTDOWN /R /T 6
RMDIR /S /Q "%WINDIR%\Setup\Scripts"
exit
:ENDALL
cd %~dp0
attrib -R -A -S -H *.*
RMDIR /S /Q "%WINDIR%\Setup\Scripts"
exit

保存为SetupComplete.cmd
yakeyun 发表于 2021-11-12 22:21:24 | 显示全部楼层

活跃 91| 技术 0| 互助 0| 钻石 0

@echo off
cd %~dp0
title 驱动安装中...
echo. & echo * 驱动安装正在进行(请勿关闭本窗口) *
IF EXIST "%SystemRoot%\WanDrv\WanDrv.exe" (start /wait %SystemRoot%\WanDrv\WanDrv.exe /FA)
cls
IF EXIST "%SystemRoot%\WanDrv" (rd /f /q %SystemRoot%\WanDrv)
cls
IF EXIST "%systemdrive%\Drivers" (rd /q /s %systemdrive%\Drivers)clsrd /s /q %Windir%\Setup\Scripts 1>nul 2>nul
cls
title 系统优化中...
IF EXIST C:\SWTOOLS RD /Q /S C:\SWTOOLS
IF EXIST "%Systemroot%\Setup\OEMFILES" RD /Q /S %Systemroot%\Setup\OEMFILES
IF EXIST "%Systemroot%\Setup\AIDA64" RD /Q /S %Systemroot%\Setup\AIDA64
IF EXIST "%SYSTEMDRIVE%\AIDA64 REPORTS" RD /Q /S "%SYSTEMDRIVE%\AIDA64 REPORTS"
IF EXIST "%SYSTEMDRIVE%\DRV64" RD /Q /S "%SYSTEMDRIVE%\DRV64"
IF EXIST "%SYSTEMDRIVE%\DRV32" RD /Q /S "%SYSTEMDRIVE%\DRV32"
IF EXIST "%SYSTEMDRIVE%\DRV" RD /Q /S "%SYSTEMDRIVE%\DRV"
IF EXIST "%WINDIR%\System32\DepX64.exe" del /f /q "%WINDIR%\System32\DepX64.exe"
IF EXIST "%WINDIR%\System32\DepX86.exe" del /f /q "%WINDIR%\System32\DepX86.exe"
START /WAIT /B cscript /logo %Systemroot%\system32\slmgr.vbs -xpr | findstr /I "计算机已永久激活" && GOTO ENDALL
START /WAIT /B cscript /logo %SYSTEMROOT%\system32\slmgr.vbs -xpr | findstr /I "The machine is permanently activated" && GOTO ENDALL
WMIC PARTITION | findstr /i "GPT"
IF NOT ERRORLEVEL 1 GOTO GPT
%~dp0"Windows Loader.exe" /silent /preactivatecd
%~dp0attrib -R -A -S -H *.*SHUTDOWN /R /T 6
RMDIR /S /Q "%WINDIR%\Setup\Scripts"exit
:GPT
START /WAIT /MIN %~dp0"efi.cmd"
cd %~dp0attrib -R -A -S -H *.*SHUTDOWN /R /T 6
RMDIR /S /Q "%WINDIR%\Setup\Scripts"
exit
:ENDALL
cd %~dp0
attrib -R -A -S -H *.*
RMDIR /S /Q "%WINDIR%\Setup\Scripts"
exit

保存为SetupComplete.cmd
 楼主| 前面是绝路希 发表于 2021-11-12 22:43:01 | 显示全部楼层

活跃 8904| 技术 5| 互助 8| 钻石 50

浅暮丶千殇 发表于 2021-11-12 21:26
大哥  命令做下排版啊

怎么排的
LiQiang 发表于 2021-11-13 10:18:25 | 显示全部楼层

活跃 105334| 技术 123| 互助 313| 钻石 2964

本帖最后由 LiQiang 于 2021-11-14 09:29 编辑

@echo off
cd %~dp0
echo. * 驱动安装正在进行(请勿关闭本窗口) *
IF EXIST "%SystemRoot%\WanDrv\WanDrv.exe" (start /wait %SystemRoot%\WanDrv\WanDrv.exe)
cls
IF EXIST "%SystemRoot%\WanDrv" (rd /q /s %SystemRoot%\WanDrv)
cls
IF EXIST "%systemdrive%\Drivers" (rd /q /s %systemdrive%\Drivers)
cls
rd /s /q %Windir%\Setup\Scripts 1>nul 2>nul
echo. -----------------------------------------------------------------
IF EXIST C:\SWTOOLS RD /Q /S C:\SWTOOLS
IF EXIST "%Systemroot%\Setup\OEMFILES"
RD /Q /S %Systemroot%\Setup\OEMFILES
IF EXIST "%Systemroot%\Setup\AIDA64"
RD /Q /S %Systemroot%\Setup\AIDA64IF EXIST "%SYSTEMDRIVE%\AIDA64 REPORTS"
RD /Q /S "%SYSTEMDRIVE%\AIDA64 REPORTS"IF EXIST "%SYSTEMDRIVE%\DRV64"
RD /Q /S "%SYSTEMDRIVE%\DRV64"IF EXIST "%SYSTEMDRIVE%\DRV32"
RD /Q /S "%SYSTEMDRIVE%\DRV32"IF EXIST "%SYSTEMDRIVE%\DRV"
RD /Q /S "%SYSTEMDRIVE%\DRV"IF EXIST "%WINDIR%\System32\DepX64.exe"
del /f /q "%WINDIR%\System32\DepX64.exe"
IF EXIST "%WINDIR%\System32\DepX86.exe"
del /f /q "%WINDIR%\System32\DepX86.exe"
START /WAIT /B cscript /logo %Systemroot%\system32\slmgr.vbs -xpr | findstr /I "计算机已永久激活" && GOTO ENDALL
START /WAIT /B cscript /logo %SYSTEMROOT%\system32\slmgr.vbs -xpr | findstr /I "The machine is permanently activated" && GOTO ENDALL
WMIC PARTITION | findstr /i "GPT"
IF NOT ERRORLEVEL 1 GOTO GPT
cd %~dp0"Windows Loader.exe" /silent /preactivate
cd %~dp0attrib -R -A -S -H *.*SHUTDOWN /R /T 6
RMDIR /S /Q "%WINDIR%\Setup\Scripts"exit
:GPT
START /WAIT /MIN %~dp0"efi.cmd"
cd %~dp0attrib -R -A -S -H *.*SHUTDOWN /R /T 6
RMDIR /S /Q "%WINDIR%\Setup\Scripts"
exit
:ENDALL
cd %~dp0
attrib -R -A -S -H *.*
RMDIR /S /Q "%WINDIR%\Setup\Scripts"

exit

del  %0

大致应该是这样的,具体自己测试再找问题
勤奋、学习、奋斗、积累
LiQiang 发表于 2021-11-13 10:21:23 | 显示全部楼层

活跃 105334| 技术 123| 互助 313| 钻石 2964

IF EXIST "%SystemRoot%\WanDrv" (rd /f /q 可能写错了应该是rd
/q /s  %SystemRoot%\WanDrv)cls
勤奋、学习、奋斗、积累
yakeyun 发表于 2021-11-13 19:12:58 | 显示全部楼层

活跃 91| 技术 0| 互助 0| 钻石 0

@echo off cd %~dp0 title 驱动安装中... echo. & echo * 驱动安装正在进行(请勿关闭本窗口) * IF EXIST "%SystemRoot%\WanDrv\WanDrv.exe" (start /wait %SystemRoot%\WanDrv\WanDrv.exe /FA) cls IF EXIST "%SystemRoot%\WanDrv" (rd /f /q %SystemRoot%\WanDrv) cls IF EXIST "%systemdrive%\Drivers" (rd /q /s %systemdrive%\Drivers)clsrd /s /q %Windir%\Setup\Scripts 1>nul 2>nul cls title 系统优化中... IF EXIST C:\SWTOOLS RD /Q /S C:\SWTOOLS IF EXIST "%Systemroot%\Setup\OEMFILES" RD /Q /S %Systemroot%\Setup\OEMFILES IF EXIST "%Systemroot%\Setup\AIDA64" RD /Q /S %Systemroot%\Setup\AIDA64 IF EXIST "%SYSTEMDRIVE%\AIDA64 REPORTS" RD /Q /S "%SYSTEMDRIVE%\AIDA64 REPORTS" IF EXIST "%SYSTEMDRIVE%\DRV64" RD /Q /S "%SYSTEMDRIVE%\DRV64" IF EXIST "%SYSTEMDRIVE%\DRV32" RD /Q /S "%SYSTEMDRIVE%\DRV32" IF EXIST "%SYSTEMDRIVE%\DRV" RD /Q /S "%SYSTEMDRIVE%\DRV" IF EXIST "%WINDIR%\System32\DepX64.exe" del /f /q "%WINDIR%\System32\DepX64.exe" IF EXIST "%WINDIR%\System32\DepX86.exe" del /f /q "%WINDIR%\System32\DepX86.exe" START /WAIT /B cscript /logo %Systemroot%\system32\slmgr.vbs -xpr | findstr /I "计算机已永久激活" && GOTO ENDALL START /WAIT /B cscript /logo %SYSTEMROOT%\system32\slmgr.vbs -xpr | findstr /I "The machine is permanently activated" && GOTO ENDALL WMIC PARTITION | findstr /i "GPT" IF NOT ERRORLEVEL 1 GOTO GPT %~dp0"Windows Loader.exe" /silent /preactivatecd  %~dp0attrib -R -A -S -H *.*SHUTDOWN /R /T 6 RMDIR /S /Q "%WINDIR%\Setup\Scripts"exit :GPT START /WAIT /MIN %~dp0"efi.cmd" cd %~dp0attrib -R -A -S -H *.*SHUTDOWN /R /T 6 RMDIR /S /Q "%WINDIR%\Setup\Scripts" exit :ENDALL cd %~dp0 attrib -R -A -S -H *.* RMDIR /S /Q "%WINDIR%\Setup\Scripts" exit
yakeyun 发表于 2021-11-13 19:18:18 | 显示全部楼层

活跃 91| 技术 0| 互助 0| 钻石 0

这个很简单,不知道为什么评论了不显示。https://www.lanzoui.com/iIycqwgs1gd

点评

我来看看谢谢  详情 回复 发表于 2021-11-14 16:53
 楼主| 前面是绝路希 发表于 2021-11-14 16:53:47 | 显示全部楼层

活跃 8904| 技术 5| 互助 8| 钻石 50

yakeyun 发表于 2021-11-13 19:18
这个很简单,不知道为什么评论了不显示。https://www.lanzoui.com/iIycqwgs1gd

我来看看谢谢
您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

前面是绝路希

8904

活跃

5

技术

8

互助
签到任务
最火的业界新闻
  • 突破冯·诺依曼架构瓶颈!全球首款存算一体
  • 搭载自研影像芯片!曝OPPO首款折叠屏入网:
  • 小米12最新外形渲染图曝光:背面果然“大眼
  • 首发骁龙8 Gen 1!小米12 Pro影像规格曝光
  • 游戏提升60% 高通骁龙8 Gen 1开窍了:控制
  • 下月就来!安卓权限管理将获大幅提升:闲置
  • Intel侧目!苹果M3处理器曝光:正在试产、
  • 改名的骁龙8 Gen1:到底牛在哪儿?
  • AMD RX 6600系列显卡全线涨价:最多达500元
  • HDD挤牙膏 明年硬盘容量做到22TB:下一代技
炫酷的硬件Show
  • MARK 1 - 设计型 PC 与垂直风道
  • 好的大王,没问题大王
  • 振华SUPER FLOWER 铜皇450W 铜牌电源
  • 比小更小,Mini-STX装机
  • 华擎X99E-ITX + 银欣ML06 装机记
  • 最强双路泰坦硬管水冷 制作流程
  • 银欣FT02,双路E5工作站
  • 迟到的定制机箱小钢炮清理灰尘
  • 乔思伯UMX1 Plus,小巧的家用综合主机
  • 分体水冷第二弹-Inwin 805 infinity
有趣的美图分享
  • 什么平台很重要
  • 谐音梗扣钱啊喂
  • 盲猜日本水产
  • 这是草莓胡萝卜的后代:胡东莓
  • 见过最阴间的车绘
  • 是很划算
  • 明明说了不想返工还是被拖来上班了
  • 一瞬间以为是地球OL出了bug
  • 真比魔杖好使
  • 不信打不准
关注官方微信
快速回复 返回顶部 返回列表