Created
May 27, 2013 20:53
-
-
Save caquino/5659030 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
SETLOCAL ENABLEDELAYEDEXPANSION | |
FOR %%A IN (%*) DO ( | |
PSEXEC.EXE \\%%A %windir%\system32\inetsrv\appcmd list requests > %TMP%\output-%%A.log 2>&1 | |
) | |
FOR %%A IN (%*) DO ( | |
TYPE %TMP%\output-%%A.log | FIND "REQUEST" >> %TMP%\output.log | |
DEL %TMP%\output-%%A.log | |
) | |
FOR /F "tokens=2,3 delims==:" %%A IN (%TMP%\output.log) DO ECHO %%A | SORT >> %TMP%\outputs.log | |
FOR /F "tokens=1,2 delims==," %%A IN (%TMP%\outputs.log) DO ECHO %%A | SORT >> %TMP%\outputc.log | |
FOR /F "tokens=1,2 delims==?" %%A IN (%TMP%\outputc.log) DO ECHO %%A | SORT >> %TMP%\outputq.log | |
FOR /F "tokens=1,2 delims==?" %%A IN (%TMP%\outputq.log) DO ( | |
IF DEFINED ELEMS["%%A"] ( | |
SET C=!ELEMS["%%A"]! | |
SET /A C+=1 | |
SET ELEMS["%%A"]=!C! | |
) ELSE ( | |
SET ELEMS["%%A"]=1 | |
) | |
) | |
FOR /F "tokens=1,2 delims==?" %%A IN (%TMP%\outputq.log) DO ( | |
IF !ELEMS["%%A"]! GTR 0 ( | |
ECHO !ELEMS["%%A"]! %%A >> %TMP%\result.log | |
SET ELEMS["%%A"]=0 | |
) | |
) | |
TYPE %TMP%\result.log | SORT /+1 /R | MORE | |
ENDLOCAL | |
DEL %TMP%\output.log | |
DEL %TMP%\output?.log | |
DEL %TMP%\result.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Me puede ayudar como ejecutar el script