我一直在研究一个批处理文件,它创建了一个像这样的变量网格:
%G1%%G2%%G3%%G4%%G5%
%G6%%G7%%G8%%G9%%G10%
%G11%%G12%%G13%%G14%%G15%
但是当我尝试运行我的批处理文件时,它只是这样写:
%G1%%G2%%G3%%G4%%G5%
Echo is off.
Echo is off.
Echo is off.
Echo is off.
我在这里添加了代码,请有人告诉我我做错了什么?
@echo off
title GirdMaker
setlocal enabledelayedexpansion
set lineid=0
set COLS=0
set LINES=0
set /p LINES=Enter number of lines:
set /p COLS=Enter the number of colums:
cls
set START=1
set linecount=0
:A
set LINE=
for /l %%I in (%START%,1,%COLS%) do (
set LINE=!LINE!%%G%%I%%
)
set /a linecount=%linecount%+1
echo %LINE%
set /a lineid=%lineid%+%COLS%+1
set START=%lineid%
if %LINES% EQU %linecount% (
pause >nul
exit
)
goto :A