我如何使用变量返回另一个具有相同名称的变量??????
%% b = file3
我想要%% b返回%file3% 比如%%% b%
我需要在%file3%等中使用值...当file3上的循环作业时。拉链
set file3=Bin64\Setup.exe -Install -output screen
set file8=Setup.exe -Install
set file11=someanotherdir\Setup.exe -options
set stuff= file.zip file1.zip file2.zip file3.zip file4.zip file5.zip file6.zip file7.zip file8.zip file9.zip file10.zip file11.zip
set count=1
:while
For /f "tokens=%count%" %%a in ("%stuff%") do (
echo %%a
set /a "count+=1"
echo File to work: %%a
for /f "tokens=1,2 delims=. " %%b in ("%%a") do (
rem ###\/ HERE [%%%b%] ???? ###
if [%%%b%] EQU [] (
echo No option detected for: %%b
goto :while
)
rem ###\/ AND HERE %%%b% ###
echo Execute this cmd for this file: %%%b%
)
pause
goto :while
)
答案 0 :(得分:0)
这会帮助你吗?
@Echo Off
SetLocal EnableDelayedExpansion
Set "file3=Setup.exe -options"
Set "file8=Setup.exe -other"
Set "file11=Setup.exe -alternative"
Set "stuff=file.zip file1.zip file2.zip file3.zip file4.zip file5.zip file6.zip file7.zip file8.zip file9.zip file10.zip file11.zip"
For %%A In (%stuff%) Do If Defined %%~nA Echo([Extracting %%A]-[Running !%%~nA!]
Timeout -1