无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 2020|回复: 35
打印 上一主题 下一主题

求一个批处理,不胜感激!

[复制链接]
1#
发表于 2024-4-30 14:06:07 | 显示全部楼层
问了下copilot 回答如下:请大家看看CHATGPT和COPILOT的区别。@echo off
setlocal enabledelayedexpansion

REM Read the first line from 000.txt
set "firstLine="
for /f "usebackq delims=" %%a in ("D:\666\000.txt") do (
    set "firstLine=%%a"
    goto :break
)
:break

REM Read the second line from 000.txt
set "secondLine="
for /f "usebackq skip=1 delims=" %%b in ("D:\666\000.txt") do (
    set "secondLine=%%b"
    goto :continue
)
:continue

REM Determine which batch file to call based on the content of the lines
if "!firstLine!"=="A" (
    if "!secondLine!"=="C" (
        call "D:\666\001.bat"
    ) else if "!secondLine!"=="D" (
        call "D:\666\002.bat"
    )
) else if "!firstLine!"=="B" (
    if "!secondLine!"=="C" (
        call "D:\666\003.bat"
    ) else if "!secondLine!"=="D" (
        call "D:\666\004.bat"
    )
)

endlocal

回复

使用道具 举报

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

本版积分规则

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

闽公网安备 35020302032614号

GMT+8, 2024-6-15 18:17

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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