Ciao a tutti,
con questo batch vorei prendere in input da un file txt (computernames.txt) una lista di computer. Poi verificare se il file info.log è minore o maggiore di 1000 byte. Nel caso in cui fosse maggiore o uguale dovrebbe inserirmi il nome macchina nel file logsizemax.txt nel caso fosse minore nel logminsize.txt . Ogni aiuto è veramente apprezzato. Mi sta facendo uscire di testa.
ehheheeh![]()
Facendolo girare mi il seguent errore:
error: 1000 was unexpected at this time
@echo off
for /f "tokens=*" %%I in (computernames.txt)do call :checksz %%I
:checksz
setlocal
set file="\\%1\c$\data\info.log"
set min=1000
FOR /F "usebackq" %%A IN ('%file%') DO set size=%%~zA
if %size% GTQ %min% (
echo. %1 >>logsizemin.txt
) ELSE (
echo. %1>>logsizemax.txt
)
Grazieee!!