SHARE
TWEET

Gather System Status (Batch)

Imthedude025 Nov 22nd, 2018 (edited) 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2. ::Gather System Status Via Batch                             ::
  3. ::Created by RU$$ [http://russdev.mooo.com/]                 ::
  4. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  5. @ECHO OFF
  6. @setlocal enabledelayedexpansion
  7. @SET NUM=1
  8. @COLOR 02
  9. @TITLE --Gather System Status--
  10.  
  11. Echo Checking System Status...
  12. Echo -------------------------------------------------------------------------------
  13.  
  14. :: Check administrator status
  15. net user "%username%" | findstr /C:"*Administrators">nul && (
  16.     Set "AD=Administrator"
  17. ) || (
  18.     Set "AD=Guest"
  19. )
  20.  
  21. Echo Current Privlage Status: [%AD%]
  22.  
  23. :: Get firewall status
  24. for /f "tokens=1,2" %%a in ('netsh advfirewall show allprofiles state^| find /i "State"') DO (
  25.  
  26. If "!NUM!"=="1" (
  27.     Set "Domain=%%b"
  28. )
  29. If "!NUM!"=="2" (
  30.     Set "Private=%%b"
  31. )
  32. If "!NUM!"=="3" (
  33.     Set "Public=%%b"
  34. )
  35. set /a NUM=!NUM! + 1)
  36. Echo Network Firewall Status: [Domain: %Domain%] - [Private: %Private%] - [Public: %Public%]
  37.  
  38. :: Get windows update status
  39. set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update"
  40. set VALUE_NAME=AUOptions
  41.  
  42. FOR /F "usebackq skip=2 tokens=1-4" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
  43.     set ValueValue=%%C %%D
  44. )
  45.  
  46. If "%ValueValue%"=="0x1 " (
  47.     Set "WUpdate=[WARNING: Never check for updates]"
  48. )
  49. If "%ValueValue%"=="0x2 " (
  50.     Set "WUpdate=[Check for updates - choose whether to download ^& install]"
  51. )
  52. If "%ValueValue%"=="0x3 " (
  53.     Set "WUpdate=[Download updates - choose whether to install]"
  54. )
  55. If "%ValueValue%"=="0x4 " (
  56.     Set "WUpdate=[Install updates automaticly]"
  57. )
  58. Echo Windows Update Status: %WUpdate%
  59.  
  60. :: Get antivirus info
  61. set num=1
  62. for /f "tokens=2 skip=2 delims=^=" %%a in ('WMIC /Node:localhost /Namespace:\\root\SecurityCenter2 Path AntiVirusProduct Get displayName /Format:List') DO (
  63.  
  64. If "!NUM!"=="1" (
  65.     Set "A1=%%a"
  66. )
  67. If "!NUM!"=="2" (
  68.     Set "A2=%%a"
  69. )
  70. set /a NUM=!NUM! + 1)
  71.  
  72. Echo Virus/Spyware Protection Status: [%A1%] [%A2%]
  73.  
  74. :: Get UAC status.
  75. for /f "tokens=3" %%a in ('REG QUERY HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\ /v EnableLUA') DO (
  76.  
  77. If "%%a"=="0x1" (
  78.     Set "ST=Enabled"
  79. )
  80. If "%%a"=="0x0" (
  81.     Set "ST=Disabled"
  82. ))
  83.  
  84. Echo Windows UAC Status: [%ST%]
  85.  
  86. :: Get smartscreen status
  87. for /f "tokens=3" %%a in ('REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ /v SmartScreenEnabled') DO (
  88.  
  89. If "%%a"=="Off" (
  90.     Set "SC=Disabled"
  91. )
  92. If "%%a"=="0x0" (
  93.     Set "SC=Enabled"
  94. ))
  95.  
  96. Echo Windows SmartScreen Status: [%SC%]
  97.  
  98. :: Get network access protection status
  99. for /f "tokens=3" %%a in ('REG QUERY HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\napagent\ /v Start') DO (
  100.  
  101. If "%%a"=="0x2" (
  102.     Set "SS=Automatic"
  103. )
  104. If "%%a"=="0x3" (
  105.     Set "SS=Manual/Off"
  106. )
  107. If "%%a"=="0x4" (
  108.     Set "SS=Disabled"
  109. )
  110. If "%%a"=="0x2" (
  111.     Set "SS=Automatic (Delayed Start)"
  112. ))
  113.  
  114. Echo Network Access Protection Status: [%SS%]
  115.  
  116. :: Get Microsoft Account status:
  117. for /f "tokens=*" %%a in ('echo %logonserver%') DO (
  118.  
  119. If "%%a"=="\\MicrosoftAccount" (Set "AC=Microsoft Account Connected") else (Set "AC=No Microsoft Account Found - Local Account")
  120. )
  121.  
  122. Echo Microsoft Account Status: [%AC%]
  123.  
  124. :: Get auto maintenance status
  125. for /f "tokens=3" %%a in ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance" /v ReportedState') DO (
  126.  
  127. If "%%a"=="0x1" (Set "WM=Enabled") ELSE (Set "WM=Disabled")
  128. )
  129.  
  130. Echo System Maintenance Status: [%WM%]
  131.  
  132. :: Home group status
  133. for /f "tokens=3" %%a in ('REG QUERY HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HomeGroupListener\ /v Start') DO (
  134.  
  135. If "%%a"=="0x2" (
  136.     Set "HG=Automatic"
  137. )
  138. If "%%a"=="0x3" (
  139.     Set "HG=Manual/Off"
  140. )
  141. If "%%a"=="0x4" (
  142.     Set "HG=Disabled"
  143. ))
  144.  
  145. Echo Windows HomeGroup Status: [%HG%]
  146.  
  147. :: Home group status
  148. for /f "tokens=3" %%a in ('REG QUERY HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\fhsvc\ /v Start') DO (
  149.  
  150. If "%%a"=="0x2" (
  151.     Set "FH=Automatic"
  152. )
  153. If "%%a"=="0x3" (
  154.     Set "FH=Manual/Off"
  155. )
  156. If "%%a"=="0x4" (
  157.     Set "FH=Disabled"
  158. ))
  159.  
  160. Echo FileHistory Status: [%FH%]
  161. Echo -------------------------------------------------------------------------------
  162. Echo(
  163. setlocal disabledelayedexpansion
  164. Echo System Scan Complete!
  165.  
  166. pause >nul
  167. goto :EOF
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top