Why this code don't work?
Code: Select all
@echo off
ping -n 2 127.0.0.1 > nul
setlocal enabledelayedexpansion
if "%1" EQU "resto" goto :resto
start "test 1" /LOW cmd /c "typeperf "\Disco fisico(_Total)\%% Tempo disco" "\Processore(_Total)\%% Tempo processore" | %0 resto > %temp%\test1.log"
start "test 2" /LOW cmd /c "typeperf "\Disco fisico(_Total)\%% Tempo disco" "\Processore(_Total)\%% Tempo processore" | FIND /V "" | %0 resto > %temp%\test2.log"
start "test 3" /LOW cmd /c "typeperf "\Disco fisico(_Total)\%% Tempo disco" "\Processore(_Total)\%% Tempo processore" | findstr /V "^$" | %0 resto > %temp%\test3.log"
start "test 4" /LOW cmd /c "typeperf "\Disco fisico(_Total)\%% Tempo disco" "\Processore(_Total)\%% Tempo processore" | more +2 | %0 resto > %temp%\test4.log"
echo Wait few second and close the windows "test X" then ...
pause
start notepad %temp%\test1.log
start notepad %temp%\test2.log
start notepad %temp%\test3.log
start notepad %temp%\test4.log
goto :eof
:resto
:loop
set /p "ln="
echo [%time%] {%ln%}
goto :loop
Output:
--------------
test 1
Code: Select all
[23.22.30,85] {}
[23.22.30,86] {"(PDH-CSV 4.0)"}
[23.22.30,87] {,"\\PC-XP-MASTER\Disco fisico(_Total)\% Tempo disco"}
[23.22.30,99] {,"\\PC-XP-MASTER\Processore(_Total)\% Tempo processore"}
[23.22.31,99] {,"\\PC-XP-MASTER\Processore(_Total)\% Tempo processore"}
[23.22.31,99] {,"1.120886"}
[23.22.32,00] {,"14.285714"}
[23.22.32,99] {,"14.285714"}
[23.22.32,99] {,"0.053763"}
[23.22.33,00] {,"5.000000"}
[23.22.34,00] {,"5.000000"}
[23.22.34,00] {,"0.056206"}
[23.22.34,01] {,"3.960396"}
[23.22.35,00] {,"3.960396"}
[23.22.35,00] {,"0.325431"}
[23.22.35,01] {,"14.000000"}
[23.22.36,01] {,"14.000000"}
[23.22.36,01] {,"1.615374"}
[23.22.36,01] {,"9.000000"}
[23.22.37,01] {,"9.000000"}
[23.22.37,01] {,"0.193342"}
[23.22.37,04] {,"9.000000"}
test 2
Code: Select all
[23.22.30,85] {}
[23.22.31,99] {"(PDH-CSV 4.0)","\\PC-XP-MASTER\Disco fi}
[23.22.31,99] {sico(_Total)\% Tempo disco","\\PC-XP-MASTER\Processore(_Total)\% Tempo processore"}
[23.22.32,99] {"06/21/2012 23:22:31.994","1.120886","14}
[23.22.32,99] {.285714"}
[23.22.34,00] {"06/21/2012 23:22:32.996","0.053763","5.}
[23.22.34,00] {000000"}
[23.22.35,00] {"06/21/2012 23:22:34.007","0.056206","3.}
[23.22.35,00] {960396"}
[23.22.36,01] {"06/21/2012 23:22:35.009","0.325431","14}
[23.22.36,01] {.000000"}
[23.22.37,01] {"06/21/2012 23:22:36.010","1.615374","9.}
[23.22.37,01] {000000"}
test 3
Code: Select all
test 4 Duplicate line
Code: Select all
[23.22.32,99] {"06/21/2012 23:22:31.994","1.120886","14.285714"}
[23.22.32,99] {"06/21/2012 23:22:31.994","1.120886","14.285714"}
[23.22.33,99] {"06/21/2012 23:22:32.996","0.053763","5.000000"}
[23.22.33,99] {"06/21/2012 23:22:32.996","0.053763","5.000000"}
[23.22.34,99] {"06/21/2012 23:22:33.997","0.056768","4.000000"}
[23.22.34,99] {"06/21/2012 23:22:33.997","0.056768","4.000000"}
[23.22.36,00] {"06/21/2012 23:22:34.999","0.325431","14.000000"}
[23.22.36,00] {"06/21/2012 23:22:34.999","0.325431","14.000000"}
?