Advertisement
BrainWaveCC

FSIT.BAT

Nov 11th, 2024
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 5.56 KB | Source Code | 0 0
  1. @echo off
  2. @REM - Original Message: https://www.reddit.com/r/Batch/comments/1goxbdr/simple_computer_info_tool_i_made_a_while_ago/
  3.  setlocal
  4.  title Friendly System Information Tool :)
  5.  color 0A
  6.  
  7. :PleaseNote
  8. :::  This script relies on the CCALC.EXE utility for returning drive sizes
  9. :::  in MB.  You can find it below:
  10. :::
  11. :::    CCALC.EXE - https://www.majorgeeks.com/files/details/brainwave_ccalc.html
  12. :::
  13.  
  14. :MainMenu
  15.  cls
  16.  echo =====================================================
  17.  echo     :) :)     FRIENDLY SYSTEM INFORMATION TOOL     :) :)
  18.  echo -----------------------------------------------------
  19.  echo What would you like to know?  Select by number:
  20.  echo:
  21.  echo   - 1. CPU         - 4. RAM         - 7. DISK
  22.  echo   - 2. GPU         - 5. OS          - 8. BIOS
  23.  echo   - 3. BOOT TIME   - 6. NETWORK     - 9. ALL (for full report)
  24.  echo:
  25.  echo   - 0. EXIT this FSIT application
  26.  echo -----------------------------------------------------
  27.  echo:
  28.  echo Current ErrorLevel = %errorlevel%
  29.  
  30.  rem Prompt user for choice
  31.  CHOICE /C 1234567890 /N /M "Your Choice (by number): "
  32.  if errorlevel 10 goto :ExitBatch
  33.  if errorlevel  9 call :getAllInfo
  34.  if errorlevel  8 call :getBIOS
  35.  if errorlevel  7 call :getDisk
  36.  if errorlevel  6 call :getNetwork
  37.  if errorlevel  5 call :getOS
  38.  if errorlevel  4 call :getRAM
  39.  if errorlevel  3 call :getBootTime
  40.  if errorlevel  2 call :getGPU
  41.  if errorlevel  1 call :getCPU
  42.  goto :MainMenu
  43.  
  44.  
  45. :getGPU
  46.  if "%~1"=="" cls
  47.  echo -----------------------------------------------------
  48.  echo                     :) GPU INFORMATION :)
  49.  echo -----------------------------------------------------
  50.  wmic path win32_videocontroller get name, driverversion
  51.  echo:
  52.  if "%~1"=="" (
  53.      echo Press any key to go back to the main menu.
  54.      pause >nul
  55.  )
  56.  goto :EOF
  57.  
  58.  
  59. :getCPU
  60.  if "%~1"=="" cls
  61.  echo -----------------------------------------------------
  62.  echo                     :) CPU INFORMATION :)
  63.  echo -----------------------------------------------------
  64.  wmic cpu get name, maxclockspeed, numberofcores, numberoflogicalprocessors
  65.  echo:
  66.  if "%~1"=="" (
  67.      echo Press any key to go back to the main menu.
  68.      pause >nul
  69.  )
  70.  goto :EOF
  71.  
  72.  
  73. :getRAM
  74.  if "%~1"=="" cls
  75.  echo -----------------------------------------------------
  76.  echo                     :) RAM INFORMATION :)
  77.  echo -----------------------------------------------------
  78.  systeminfo | findstr /C:"Total Physical Memory" /C:"Available Physical Memory"
  79.  echo:
  80.  if "%~1"=="" (
  81.      echo Press any key to go back to the main menu.
  82.      pause >nul
  83.  )
  84.  goto :EOF
  85.  
  86.  
  87. :getDisk
  88.  if "%~1"=="" cls
  89.  setlocal EnableDelayedExpansion
  90.  echo -----------------------------------------------------
  91.  echo                  :) DISK SPACE INFORMATION :)
  92.  echo -----------------------------------------------------
  93.  for /f "tokens=1-3 delims= " %%A in ('wmic logicaldisk where "drivetype=3" get DeviceID^, Size^, FreeSpace ^| find ":"') do (
  94.      call :CalcMB TotalSpace %%C
  95.      call :CalcMB FreeSpace  %%B
  96.      echo Drive %%A - Total: !TotalSpace! MB,   Free: !FreeSpace! MB
  97.  )
  98.  echo:
  99.  if "%~1"=="" (
  100.      echo Press any key to go back to the main menu.
  101.      pause >nul
  102.  )
  103.  endlocal
  104.  goto :EOF
  105.  
  106.  
  107. :getOS
  108.  if "%~1"=="" cls
  109.  echo -----------------------------------------------------
  110.  echo                  :) OPERATING SYSTEM INFO :)
  111.  echo -----------------------------------------------------
  112.  systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type"
  113.  echo:
  114.  if "%~1"=="" (
  115.      echo Press any key to go back to the main menu.
  116.      pause >nul
  117.  )
  118.  goto :EOF
  119.  
  120.  
  121. :getBIOS
  122.  if "%~1"=="" cls
  123.  echo -----------------------------------------------------
  124.  echo                   :) BIOS INFORMATION :)
  125.  echo -----------------------------------------------------
  126.  wmic bios get name, version, serialnumber
  127.  echo:
  128.  if "%~1"=="" (
  129.      echo Press any key to go back to the main menu.
  130.      pause >nul
  131.  )
  132.  goto :EOF
  133.  
  134.  
  135. :getBootTime
  136.  if "%~1"=="" cls
  137.  echo -----------------------------------------------------
  138.  echo                :) LAST SYSTEM BOOT TIME :)
  139.  echo -----------------------------------------------------
  140.  wmic os get lastbootuptime | findstr /B /C:"2"
  141.  echo:
  142.  if "%~1"=="" (
  143.      echo Press any key to go back to the main menu.
  144.      pause >nul
  145.  )
  146.  goto :EOF
  147.  
  148.  
  149. :getNetwork
  150.  if "%~1"=="" cls &  echo Current ErrorLevel = %errorlevel%
  151.  
  152.  echo -----------------------------------------------------
  153.  echo                :) NETWORK CONFIGURATION :)
  154.  echo -----------------------------------------------------
  155.  ipconfig | findstr /C:"IPv4 Address" /C:"Default Gateway" /C:"Subnet Mask"
  156.  echo:
  157.  echo MAC Address:
  158.  wmic nic where "netenabled=true" get name, macaddress
  159.  echo:
  160.  if "%~1"=="" (
  161.      echo Press any key to go back to the main menu.
  162.      pause >nul
  163.  )
  164.  goto :EOF
  165.  
  166.  
  167. :getAllInfo
  168.  if "%~1"=="" cls
  169.  echo =====================================================
  170.  echo           :) FULL SYSTEM INFORMATION REPORT :)
  171.  echo =====================================================
  172.  echo:
  173.  call :getGPU NoPause
  174.  call :getCPU NoPause
  175.  call :getRAM NoPause
  176.  call :getDisk NoPause
  177.  call :getOS NoPause
  178.  call :getBIOS NoPause
  179.  call :getBootTime NoPause
  180.  call :getNetwork NoPause
  181.  
  182.  echo :)
  183.  echo Thanks for using the tool! Press any key to return to the main menu.
  184.  pause >nul
  185.  goto :MainMenu
  186.  
  187.  
  188. :CalcMB - %1 = Variable name; %2 = Number of divide by 1048576 (1MB)
  189.  if "%~1"=="" goto :EOF
  190.  if "%~2"=="" goto :EOF
  191.  for /f %%Z in ('CCALC %~2 / 1048576 /F "#,###" 2^>NUL') do set %~1=%%~Z
  192.  timeout 0 >nul
  193.  goto :EOF
  194.  
  195.  
  196. :ExitBatch
  197.  echo Thanks for using the FSIT!
  198.  exit /b
  199.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement