Advertisement
ivandrofly

Show local connected PC

Jan 31st, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. REM IP SCANNER BY IVANDRO ISMAEL GOMES JAO - v3.1
  2. @Echo OFF
  3. Cls
  4. SETLOCAL ENABLEDELAYEDEXPANSION
  5. TITLE Wi-Fi Scanner v3.1 by: Ivandro Ismael
  6. REM RUN AS ADMIN BECAUSE "PING" IS A ADMIN'S COMMAND
  7. REM BY IVANDROFLY
  8. :MENU
  9. Echo.
  10. Echo.
  11. Echo ^<^< Wi-Fi Scanner ^>^>
  12. Echo.
  13. Echo ##############################################################
  14. Echo # #
  15. Echo # BATCH SCRIPT CREATED BY: Ivandro Ismael #
  16. Echo # #
  17. Echo # http://www.facebook.com/groups/hightechia/ #
  18. Echo # #
  19. Echo ##############################################################
  20. Echo.
  21. Set /p "_start= Enter Start Number ==> "
  22. Set /p "_end= Enter End Number ==> "
  23. Set /a "_disconnected=0"
  24. Set /a "_connected=0"
  25. Echo.
  26.  
  27. REM THIS For IS USED For COUTING
  28. For /l %%I In (%_start%,1,%_end%) do (
  29. REM This For will find computer name, I could not add 'delims= "' delims are Set by default as 'SPACE and TAB'
  30. For /f "tokens=2 delims= " %%G In ('ping -a -w 100 -n 1 -i 1 192.168.1.%%I ^| find "Pinging"') do (
  31. Rem This script line will find computer status
  32. For /f "tokens=11,12 delims=, " %%A In ('ping -a -w 100 -n 1 -i 1 192.168.1.%%I ^| find "Packets"') do (
  33. Set _IP=%%G
  34. Set _STATUS=%%A
  35. Echo.
  36. If "!_STATUS:~1,3!" == "100" (
  37. rem this counter need to be restarted
  38. Set /a _disconnected += 1
  39. ) Else (
  40. rem this counter need to be restarted
  41. Set /a _connected += 1
  42. Echo ======================================
  43. Echo 1^) - User [%%G] is Connected^^!
  44. Echo 2^) - Computer IP - 192.168.1.%%I
  45. REM (0% loos)
  46. Echo 3^) - User Status ---^> %%A %%B
  47. Echo ======================================
  48. )
  49. )
  50. )
  51. )
  52. Echo.
  53. Echo.
  54. Echo ++++++ Scanning Reports ++++++
  55. Echo.
  56. Echo ====================================
  57. Echo Total Connected Devices [!_connected!]
  58. Echo ====================================
  59. Echo Total Disconnected Devices [!_disconnected!]
  60. Echo ====================================
  61. :Label_Check
  62. Echo.
  63. Echo.
  64.  
  65. Echo Do you want to check my Web-Site?
  66. Set /p "_web=Type (y/n): "
  67.  
  68. If /i "!_web:~0,1!" == "y" (
  69. start http://www.facebook.com/groups/hightechia/
  70. Cls && goto :Else
  71. ) Else If /i "!_web:~0,1!" == "~0,1" (
  72. Echo.
  73. Echo Nothing entered on the variable,
  74. Echo make sure you entered something and re-run the scripts
  75. Timeout /t 5 /nobreak >nul && Cls && Goto :Label_Check
  76. ) Else (
  77. :Else
  78. Echo.
  79. Echo.
  80. Echo Do you want to Re-Scan?
  81. Set /P "_RSCAN=Type (y/n)==> "
  82.  
  83. If /i "!_RSCAN:~0,1!" == "y" (
  84. Cls && GOTO :MENU
  85. ) Else If /i "!_RSCAN!" == "n" (
  86. Echo.
  87. Echo Thanks For using this scripts
  88. Timeout /t 5 >nul && exit /b
  89. ) Else (
  90. Echo.
  91. Echo You entered invalid option
  92. Echo Check you option and try again^^!^^!
  93. pause >nul
  94. Cls && goto :Else
  95. )
  96. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement