gpt4 book ai didi

batch-file - 将 DIR 命令中的第一个文件传递给变量

转载 作者:行者123 更新时间:2023-12-04 01:23:27 24 4
gpt4 key购买 nike

我想传递返回的第一个文件

dir *.png /B

进入变量 %firstFile%

最佳答案

为什么需要dir ?

for %%x in (*.png) do if not defined firstFile set "firstFile=%%x"

关于batch-file - 将 DIR 命令中的第一个文件传递给变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9624071/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com