我有一個Windows批處理文件讀取文件,從它那裏得到一些信息,比如機器的IP,然後打印一些註冊表值,這臺機器,這樣的事情:內Windows批處理轉到FOR循環
for /f "skip=1 tokens=1,2,3,4,5,6,* delims=;" %%a in ('findstr /R "^" z:\csp\levantamento\levantamentoNOVO.csv') do (
set /A "HOME=0"
:cicle
echo HOME%HOME%
echo \\%%c\HKLM\SOFTWARE\ORACLE\HOME%HOME%
reg query \\%%c\HKLM\SOFTWARE\ORACLE\HOME%HOME% /v ORACLE_HOME
if %HOME% leq 3 (
set /A "HOME+=1"
goto cicle
) else (
echo.
)
echo Conenction to %%a deleted
)
和我的輸出是這樣的:
HOME0 \\10.13.3.27\HKLM\SOFTWARE\ORACLE\HOME0 HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0 ORACLE_HOME REG_EXPAND_SZ d:\oracle\806 HOME1 \\%c\HKLM\SOFTWARE\ORACLE\HOME1 ERROR: The network path was not found. HOME2 \\%c\HKLM\SOFTWARE\ORACLE\HOME2 ERROR: The network path was not found. HOME3 \\%c\HKLM\SOFTWARE\ORACLE\HOME3 ERROR: The network path was not found. HOME4 \\%c\HKLM\SOFTWARE\ORACLE\HOME4 ERROR: The network path was not found. Conenction to %a deleted
當我做了轉到cicle,看起來好像是FOR循環不知道了帽子%% c和%% c是。我真的不知道我做錯了什麼。
如果在'for'循環中使用'goto'命令,'for'被取消,不會有更多迭代,'for'可替換參數/變量超出範圍。 –
好吧...不知道那個.... –
那麼,有沒有辦法做我想要的? –