I need help with my script below:
It does not continue for the next row of machine.txt If I put the ")" after "echo !machine", it shows the machines inside the machine.txt, therefore, it works!
But when the ")" is at the end of the script it does not continue, and exit..
@echo off
set server=\\server01\share
dir /b /o %server% |find "i32" |more +2 > 32.txt
FOR /F "tokens=*" %%A in (32.txt) do SET file32=%%A
dir /b /o %server% |find "i64" |more +2 > 64.txt
FOR /F "tokens=*" %%B in (64.txt) do SET file64=%%B
setlocal EnableDelayedExpansion
for /f "tokens=*" %%C in (machines.txt) do (
set "machine=%%C"
echo !machine!
if exist "\\!machine!\c$\Program Files (x86)" goto 64bits
goto goo
:goo
if exist "\\!machine!\c$\Arquivos de Programas (x86)" goto 64bits
goto 32bits
:64bits
xcopy /D /Y /F /C %server%\%file64% \\!machine!\c$\
PsExec.exe -d \\!machine! "C:\%file64%" /q
goto end
:32bits
xcopy /D /Y /F /C %server%\%file32% \\!machine!\c$\
PsExec.exe -d \\!machine! "C:\%file32%" /q
goto end
:end
echo Finished !micro!
)
pause
Any idea? Thanks!