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