标签:获取文件 for lims 循环 dexp ble txt 获取 code
@echo off setlocal enabledelayedexpansion for /f "delims=" %%a in (‘dir /b Test*.txt‘) do ( set temp=%%a set tempname=!temp:~0,4! if not exist !tempname!.txt ( echo hello >> !tempname!.txt ) )
如果需要在For中进行变量赋值:setlocal enabledelayedexpansion,否则变量赋值是空。同时如果需要使用for中的临时变量需要使用"!"。
标签:获取文件 for lims 循环 dexp ble txt 获取 code
原文地址:https://www.cnblogs.com/zhongqingshen/p/12083050.html