hackoofr

Wi-Fi_Diagnostic_Report.bat

Dec 25th, 2022
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.35 KB | Source Code | 0 0
  1. @echo off
  2. @REM This batch script generates a wireless network report saved in an HTML file, which you can open in your favorite web browser.
  3. @REM The report shows all the Wi-Fi events for the last three days and groups them by Wi-Fi connection sessions.
  4. @REM It also shows the results of several network-related command line scripts and lists all the network adapters in your PC.
  5. Mode 80,15
  6. Title Get Wi-Fi Diagnostic Report
  7. :::::::::::::::::::::::::::::::::::::::::
  8. :: Automatically check & and start the batch file with admin rights
  9. :::::::::::::::::::::::::::::::::::::::::
  10. (Net session >nul 2>&1)||(PowerShell start """%~0""" -verb RunAs & Exit /B)
  11. Call :GetFileNameWithDateTime MyCurrentDate
  12. netsh wlan show wlanreport
  13. Set "wlan_report=%ProgramData%\Microsoft\Windows\WlanReport\wlan-report-latest.html"
  14. If exist "%wlan_report%" Copy "%wlan_report%" "%~dp0wlan-report-latest_%MyCurrentDate%.html">nul
  15. Start "" "%~dp0wlan-report-latest_%MyCurrentDate%.html" & exit
  16. ::----------------------------------------------------------------------------------
  17. :GetFileNameWithDateTime <FileName>
  18. for /f "skip=1" %%x in ('wmic os get localdatetime') do if not defined MyDate set "MyDate=%%x"
  19. set "%1=%MyDate:~0,4%-%MyDate:~4,2%-%MyDate:~6,2%-%MyDate:~8,2%-%MyDate:~10,2%"
  20. Exit /B
  21. ::----------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment