如果我在批处理文件下面运行,那么它正常工作,7z
和timeout
被识别
FOR %%A IN (% C:\dfsdf_asdffd\dd_etgvssd%\*.axml) DO (
setlocal
set filename=%%A
call :tests
)
exit /b
:tests
set newname=%filename:~14%
set transname=%filename:~25%
timeout 5
7z e %newname%
move *.xml Agile_Original.xml
exit /b
但如果我在批处理文件下面运行,那么cmd
会说7z
,timeout
无法识别。
For /F "tokens=1* delims==" %%A IN (Input_values.properties) DO (
IF "%%A"=="path" set path=%%B
IF "%%A"=="url" set url=%%B
IF "%%A"=="username" set username=%%B
IF "%%A"=="password" set password=%%B
IF "%%A"=="location" set location=%%B
)
FOR %%A IN (% C:\dfsdf_asdffd\dd_etgvssd%\*.axml) DO (
setlocal
set filename=%%A
call :tests
)
exit /b
:tests
set newname=%filename:~14%
set transname=%filename:~25%
timeout 5
7z e %newname%
move *.xml Agile_Original.xml
exit /b
如您所见,我刚刚添加了一个循环来读取properties
文件
答案 0 :(得分:4)
请勿将%path%
用作用户变量。它是一个系统变量,告诉窗口在哪里可以找到它的可执行文件。将其更改为其他名称。
(同样适用于%username%
,但