Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 27 |
Nodes: | 6 (0 / 6) |
Uptime: | 38:03:02 |
Calls: | 631 |
Calls today: | 2 |
Files: | 1,187 |
D/L today: |
22 files (29,767K bytes) |
Messages: | 173,682 |
"%LOGDIR%\._sysinfo_dir_test" echo OK 2>nul || echo write test failed for %LOGDIR%if exist "%LOGDIR%\._sysinfo_dir_test" del "%LOGDIR%\._sysinfo_dir_test" >nul 2>nul
"%PS1%" (echo $out = "%MSINFO_TXT%"
sysinfo.bat
Outputs desired system information to console & to a timestamped log file.
This sysinfo.bat file outputs on my system everything I can think of
that doesn't require elevation. What's missing that you would want?
@echo off
REM Purpose: Outputs system information
REM sysinfo.bat (version 1.0 20250922) output system information
REM sysinfo.bat (version 1.1 20250923) added msinfo32 wrapper
REM sysinfo.bat (version 1.2 20250924) added hotfixes & installed programs,
REM firewall, winrm, secureboot, driver checks & write test
REM sysinfo.bat (version 1.3 20250925) added driverquery, secureboot
REM virtualization checks & directory existence/writability checks
REM sysinfo.bat (version 1.4 20250927) commented out WinRM checks
REM as they required elevated permissions. Kept all else.
REM Usage: double-click, Win+R, or run from cmd.
REM Outputs timestamped log (e.g., C:\data\sys\log\sysinfo20250927_123456.log)
REM Comment linelength limit ===================================================
:: CONFIGURATION
set MSINFO_TIMEOUT=60 REM seconds to wait for msinfo32 before fallback
set TARGET_HTTP=example.com
set TARGET_PING=8.8.8.8
set "LOGDIR=C:\data\sys\log" REM change if you prefer another directory
if "%1"=="__LOGGING__" goto :run_script
:: build timestamp (locale-safe for Windows 10)
for /f "tokens=1-4 delims=/ " %%a in ("%DATE%") do (
set DOW=%%a
set MM=%%b
set DD=%%c
set YYYY=%%d
)
for /f "tokens=1-3 delims=:." %%a in ("%TIME%") do (
set HH=%%a
set Min=%%b
set Sec=%%c
)
if "%HH:~0,1%"==" " set HH=0%HH:~1,1%
set LOGSTAMP=%YYYY%%MM%%DD%_%HH%%Min%%Sec%
set "LOGFILE=%LOGDIR%\sysinfo%LOGSTAMP%.log"
set "TMPTXT=%LOGDIR%\sysinfo%LOGSTAMP%.tmp"
:: Ensure required directories exist (creates LOGDIR and parents if needed)
if not exist "%LOGDIR%" (
md "%LOGDIR%" 2>nul
if errorlevel 1 echo WARNING: failed to create %LOGDIR%
)
:: Stream the second invocation live; Tee-Object writes an intermediate text file
powershell -NoProfile -Command ^
" & { & cmd /c '\"%~f0\" __LOGGING__' 2>&1 | Tee-Object -FilePath '%TMPTXT%' }"
:: Convert intermediate file to UTF-8 without BOM and remove temp
powershell -NoProfile -Command ^
" [System.IO.File]::WriteAllText('%LOGFILE%', (Get-Content -Raw -LiteralPath '%TMPTXT%'), (New-Object System.Text.UTF8Encoding($false))); Remove-Item -LiteralPath '%TMPTXT%' -ErrorAction SilentlyContinue"
echo.
echo Log created at %LOGFILE%
echo.
pause
exit /b
:run_script
echo [%DATE% %TIME%] sysinfo starting...
echo ==============================================
REM SECTION: invocation and basic info
echo script = %~f0
echo args = %*
echo COMSPEC = %COMSPEC%
echo current user = %USERNAME%\%USERDOMAIN%
echo user profile = %USERPROFILE%
echo local appdata = %LOCALAPPDATA%
echo temp = %TEMP%
echo
REM SECTION: ensure directories needed and test writability
REM Ensure the log directory exists and is writable by this user
echo -- Directory checks --
echo LOGDIR = %LOGDIR%
if exist "%LOGDIR%" ( echo LOGDIR exists ) else ( echo LOGDIR missing )
echo -- test write access to LOGDIR --
> "%LOGDIR%\._sysinfo_dir_test" echo OK 2>nul || echo write test failed for %LOGDIR%
if exist "%LOGDIR%\._sysinfo_dir_test" del "%LOGDIR%\._sysinfo_dir_test" >nul 2>nul
echo REM If the write test fails, logs may not be saved.
echo
REM SECTION: OS and system info
echo -- OS basic --
ver
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Boot Time" 2>nul || systeminfo | findstr /I "OS" 2>nul
echo
REM SECTION: Powershell and path
echo -- PowerShell and execution policy --
where powershell 2>nul || echo powershell NOTFOUND
powershell -NoProfile -Command "$PSVersionTable.PSVersion; Get-ExecutionPolicy -List" 2>nul || echo PowerShell info not available
echo
REM SECTION: environment and PATH
echo -- Environment variables --
echo PATH = %PATH%
echo PROGRAMFILES = %PROGRAMFILES%
echo PROGRAMFILES(X86) = %PROGRAMFILES(X86)%
echo PROGRAMDATA = %PROGRAMDATA%
echo TEMP = %TEMP%
echo
REM SECTION: filesystem and free space
echo -- Filesystem free space --
wmic logicaldisk get name,freespace,filesystem 2>nul
echo
REM SECTION: code page and locale
echo -- Code page and locale --
chcp
powershell -NoProfile -Command "[System.Globalization.CultureInfo]::InstalledUICulture.DisplayName" 2>nul
echo
REM SECTION: networking basics
echo -- Networking: adapters, routes, listeners --
ipconfig /all
echo ------------------------
route print
echo ------------------------
netstat -ano
echo ------------------------
echo -- DNS/HTTP check --
nslookup %TARGET_HTTP%
echo ------------------------
ping -n 4 %TARGET_PING%
echo
REM SECTION: proxy and WinHTTP settings
echo -- Proxy and WinHTTP --
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable 2>nul
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer 2>nul
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL 2>nul
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoDetect 2>nul
echo netsh winhttp show proxy
netsh winhttp show proxy
echo
REM SECTION: installed tools and versions
echo -- Installed tools (where/versions if present) --
where curl 2>nul || echo curl NOTFOUND
where git 2>nul || echo git NOTFOUND
where python 2>nul || echo python NOTFOUND
where node 2>nul || echo node NOTFOUND
where gvim 2>nul || echo gvim NOTFOUND
echo
where curl 2>nul && curl -s --version 2>nul || echo curl version unknown
echo
REM SECTION: installed hotfixes and programs
echo -- Installed hotfixes (quick list) --
wmic qfe get HotFixID,InstalledOn 2>nul || echo qfe list not available
echo
echo -- Installed programs (registry uninstall keys, compact) --
reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" /s /v DisplayName 2>nul | findstr /I /C:"DisplayName" || echo no registry uninstall info
echo
REM SECTION: firewall and remote config
echo -- Windows Firewall state --
netsh advfirewall show allprofiles state 2>nul
echo -- Firewall outbound block rules (summary) --
netsh advfirewall firewall show rule name=all | findstr /I /C:"Block" 2>nul
REM -- WinRM / Remote Management --
REM WinRM checks commented out per user request; enabling WinRM requires admin actions and firewall changes
REM winrm quickconfig 2>nul
echo
REM SECTION: services and scheduled tasks (summary)
echo -- Services summary --
sc query state= all | findstr /I /C:"SERVICE_NAME" /C:"DISPLAY_NAME" 2>nul
echo -- Scheduled tasks (verbose list) --
schtasks /query /fo LIST /v 2>nul
echo
REM SECTION: user rights and elevation
echo -- User rights --
whoami /groups
net session >nul 2>&1 && echo ELEVATED || echo NOT_ELEVATED
echo
REM SECTION: PATH search sample
echo -- PATH search sample --
where cmd 2>nul
where powershell 2>nul
where curl 2>nul
echo
REM SECTION: driver summary
echo -- Driver query (brief) --
driverquery /fo table /v 2>nul | findstr /I /C:"Driver" /C:"State" || echo driverquery not available
echo
REM ---------- msinfo32 with spinner and timeout using temporary PS script ----------
echo SECTION: msinfo32 brief report (may take a while)
set "MSINFO_TXT=%TEMP%\msinfo_report.txt"
if exist "%MSINFO_TXT%" del "%MSINFO_TXT%" >nul 2>&1
echo Running msinfo32 (may take up to %MSINFO_TIMEOUT% seconds)... please wait
:: create temporary PowerShell script (ASCII-safe)
set "PS1=%TEMP%\diag_msinfo_wrapper.ps1"
> "%PS1%" (
echo $out = "%MSINFO_TXT%"
echo $timeout = %MSINFO_TIMEOUT%
echo $p = Start-Process -FilePath "msinfo32.exe" -ArgumentList "/report",$out -PassThru
echo $sw = [Diagnostics.Stopwatch]::StartNew()
echo while(-not (Test-Path $out) -and $sw.Elapsed.TotalSeconds -lt $timeout) {
echo Write-Host -NoNewline "."
echo Start-Sleep -Seconds 1
echo }
echo Write-Host ""
echo if(Test-Path $out) {
echo Write-Output "--- start msinfo32 report ---"
echo Get-Content -Path $out ^| Select-String -Pattern "^(System Model|System Manufacturer|BIOS Version|BIOS Date|OS Name|OS Version|System Type|Total Physical Memory|Available Physical Memory)" -SimpleMatch
echo Write-Output "--- end msinfo32 report ---"
echo } else {
echo Write-Output ("msinfo32 timed out after " + $timeout + " seconds; killing msinfo32 and showing compact WMI fallback")
echo try { Stop-Process -Id $p.Id -Force -ErrorAction SilentlyContinue } catch {}
echo $f = Get-CimInstance Win32_ComputerSystem
echo $b = Get-CimInstance Win32_BIOS
echo Write-Output ("System Manufacturer: " + $f.Manufacturer)
echo Write-Output ("System Model: " + $f.Model)
echo Write-Output ("System Type: " + $f.SystemType)
echo Write-Output ("Total Physical Memory: " + ([math]::Round($f.TotalPhysicalMemory/1MB)) + " MB")
echo Write-Output ("BIOS Version: " + $b.SMBIOSBIOSVersion)
echo Write-Output ("BIOS Date: " + $b.ReleaseDate)
echo }
)
:: run the temporary PowerShell script
powershell -NoProfile -ExecutionPolicy Bypass -File "%PS1%"
:: remove the temporary PowerShell script
del "%PS1%" >nul 2>&1
echo
REM SECTION: PowerShell Get-ComputerInfo selected fields
echo -- Get-ComputerInfo selected fields --
powershell -NoProfile -Command ^
" $ci = Get-ComputerInfo; ^
$props = 'CsName','WindowsProductName','WindowsVersion','OsBuildNumber','OsArchitecture','OsHotFixes','CsManufacturer','CsModel','CsSystemType','BiosManufacturer','BiosVersion','BiosReleaseDate','CsProcessors','CsTotalPhysicalMemory'; ^
foreach($p in $props) { if($ci.$p -ne $null) { Write-Output ($p + ': ' + ($ci.$p -join ', ')) } } " 2>nul || echo Get-ComputerInfo not available
echo
REM SECTION: Secure Boot and virtualization
echo -- Secure Boot and virtualization --
powershell -NoProfile -Command "if (Get-ItemProperty -Path HKLM:\\SYSTEM\\CurrentControlSet\\Control\\SecureBoot\\State -Name UEFISecureBootEnabled -ErrorAction SilentlyContinue) { Write-Output 'SecureBoot: Enabled' } else { Write-Output 'SecureBoot: Disabled or not supported' }" 2>nul || echo SecureBoot check not available
powershell -NoProfile -Command "Get-CimInstance Win32_ComputerSystem | Select-Object -Property HypervisorPresent,TotalPhysicalMemory" 2>nul || echo virtualization info not available
echo
REM SECTION: important environment variables
echo USERNAME = %USERNAME%
echo USERDOMAIN = %USERDOMAIN%
echo COMPUTERNAME = %COMPUTERNAME%
echo HOMEDRIVE = %HOMEDRIVE%
echo HOMEPATH = %HOMEPATH%
echo USERPROFILE = %USERPROFILE%
echo LOCALAPPDATA = %LOCALAPPDATA%
echo PROGRAMFILES = %PROGRAMFILES%
echo PROGRAMFILES(X86) = %PROGRAMFILES(X86)%
echo PROGRAMDATA = %PROGRAMDATA%
echo PATH = %PATH%
echo
REM SECTION: script context and permissions
echo current directory = %CD%
echo script fullpath = %~f0
echo script drive = %~d0
echo script folder = %~dp0
echo args = %*
icacls "%LOGDIR%" 2>nul || echo icacls unavailable
echo
REM SECTION: final notes and guidance for readers
echo -- Notes --
echo 1) This script writes the final log as UTF-8 without BOM so modern tools can parse it.
echo 2) Save this batch file ANSI or UTF-8 without BOM to avoid BOM artifacts in cmd display.
echo 3) msinfo32 may take up to %MSINFO_TIMEOUT% seconds; the script shows a dot spinner and falls back to a WMI summary if timed out.
echo 4) TARGET_HTTP and TARGET_PING are configurable at the top of this file.
echo 5) If you attach the produced log, include the first 30 lines and any error sections.
echo
echo Please attach the produced log file sysinfo%LOGSTAMP%.log when asking for help.
echo ==============================================
exit /b
sysinfo.batWhy write a batch when free Speccy will do the job and save info in a file ? --- Synchronet 3.21a-Linux NewsLink 1.2
Outputs desired system information to console & to a timestamped log file.
This sysinfo.bat file outputs on my system everything I can think of
that doesn't require elevation. What's missing that you would want?
@echo off
REM Purpose: Outputs system information
REM sysinfo.bat (version 1.0 20250922) output system information
REM sysinfo.bat (version 1.1 20250923) added msinfo32 wrapper
REM sysinfo.bat (version 1.2 20250924) added hotfixes & installed programs,
REM firewall, winrm, secureboot, driver checks & write test
REM sysinfo.bat (version 1.3 20250925) added driverquery, secureboot
REM virtualization checks & directory existence/writability checks
REM sysinfo.bat (version 1.4 20250927) commented out WinRM checks
REM as they required elevated permissions. Kept all else.
REM Usage: double-click, Win+R, or run from cmd.
REM Outputs timestamped log (e.g., C:\data\sys\log\sysinfo20250927_123456.log)
REM Comment linelength limit ===================================================
:: CONFIGURATION
set MSINFO_TIMEOUT=60 REM seconds to wait for msinfo32 before fallback
set TARGET_HTTP=example.com
set TARGET_PING=8.8.8.8
set "LOGDIR=C:\data\sys\log" REM change if you prefer another directory
if "%1"=="__LOGGING__" goto :run_script
:: build timestamp (locale-safe for Windows 10)
for /f "tokens=1-4 delims=/ " %%a in ("%DATE%") do (
set DOW=%%a
set MM=%%b
set DD=%%c
set YYYY=%%d
)
for /f "tokens=1-3 delims=:." %%a in ("%TIME%") do (
set HH=%%a
set Min=%%b
set Sec=%%c
)
if "%HH:~0,1%"==" " set HH=0%HH:~1,1%
set LOGSTAMP=%YYYY%%MM%%DD%_%HH%%Min%%Sec%
set "LOGFILE=%LOGDIR%\sysinfo%LOGSTAMP%.log"
set "TMPTXT=%LOGDIR%\sysinfo%LOGSTAMP%.tmp"
:: Ensure required directories exist (creates LOGDIR and parents if needed)
if not exist "%LOGDIR%" (
md "%LOGDIR%" 2>nul
if errorlevel 1 echo WARNING: failed to create %LOGDIR%
)
:: Stream the second invocation live; Tee-Object writes an intermediate text file
powershell -NoProfile -Command ^
" & { & cmd /c '\"%~f0\" __LOGGING__' 2>&1 | Tee-Object -FilePath '%TMPTXT%' }"
:: Convert intermediate file to UTF-8 without BOM and remove temp
powershell -NoProfile -Command ^
" [System.IO.File]::WriteAllText('%LOGFILE%', (Get-Content -Raw -LiteralPath '%TMPTXT%'), (New-Object System.Text.UTF8Encoding($false))); Remove-Item -LiteralPath '%TMPTXT%' -ErrorAction SilentlyContinue"
echo.
echo Log created at %LOGFILE%
echo.
pause
exit /b
:run_script
echo [%DATE% %TIME%] sysinfo starting...
echo ==============================================
REM SECTION: invocation and basic info
echo script = %~f0
echo args = %*
echo COMSPEC = %COMSPEC%
echo current user = %USERNAME%\%USERDOMAIN%
echo user profile = %USERPROFILE%
echo local appdata = %LOCALAPPDATA%
echo temp = %TEMP%
echo
REM SECTION: ensure directories needed and test writability
REM Ensure the log directory exists and is writable by this user
echo -- Directory checks --
echo LOGDIR = %LOGDIR%
if exist "%LOGDIR%" ( echo LOGDIR exists ) else ( echo LOGDIR missing )
echo -- test write access to LOGDIR --
> "%LOGDIR%\._sysinfo_dir_test" echo OK 2>nul || echo write test failed for %LOGDIR%
if exist "%LOGDIR%\._sysinfo_dir_test" del "%LOGDIR%\._sysinfo_dir_test" >nul 2>nul
echo REM If the write test fails, logs may not be saved.
echo
REM SECTION: OS and system info
echo -- OS basic --
ver
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Boot Time" 2>nul || systeminfo | findstr /I "OS" 2>nul
echo
REM SECTION: Powershell and path
echo -- PowerShell and execution policy --
where powershell 2>nul || echo powershell NOTFOUND
powershell -NoProfile -Command "$PSVersionTable.PSVersion; Get-ExecutionPolicy -List" 2>nul || echo PowerShell info not available
echo
REM SECTION: environment and PATH
echo -- Environment variables --
echo PATH = %PATH%
echo PROGRAMFILES = %PROGRAMFILES%
echo PROGRAMFILES(X86) = %PROGRAMFILES(X86)%
echo PROGRAMDATA = %PROGRAMDATA%
echo TEMP = %TEMP%
echo
REM SECTION: filesystem and free space
echo -- Filesystem free space --
wmic logicaldisk get name,freespace,filesystem 2>nul
echo
REM SECTION: code page and locale
echo -- Code page and locale --
chcp
powershell -NoProfile -Command "[System.Globalization.CultureInfo]::InstalledUICulture.DisplayName" 2>nul
echo
REM SECTION: networking basics
echo -- Networking: adapters, routes, listeners --
ipconfig /all
echo ------------------------
route print
echo ------------------------
netstat -ano
echo ------------------------
echo -- DNS/HTTP check --
nslookup %TARGET_HTTP%
echo ------------------------
ping -n 4 %TARGET_PING%
echo
REM SECTION: proxy and WinHTTP settings
echo -- Proxy and WinHTTP --
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable 2>nul
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer 2>nul
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL 2>nul
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoDetect 2>nul
echo netsh winhttp show proxy
netsh winhttp show proxy
echo
REM SECTION: installed tools and versions
echo -- Installed tools (where/versions if present) --
where curl 2>nul || echo curl NOTFOUND
where git 2>nul || echo git NOTFOUND
where python 2>nul || echo python NOTFOUND
where node 2>nul || echo node NOTFOUND
where gvim 2>nul || echo gvim NOTFOUND
echo
where curl 2>nul && curl -s --version 2>nul || echo curl version unknown
echo
REM SECTION: installed hotfixes and programs
echo -- Installed hotfixes (quick list) --
wmic qfe get HotFixID,InstalledOn 2>nul || echo qfe list not available
echo
echo -- Installed programs (registry uninstall keys, compact) --
reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" /s /v DisplayName 2>nul | findstr /I /C:"DisplayName" || echo no registry uninstall info
echo
REM SECTION: firewall and remote config
echo -- Windows Firewall state --
netsh advfirewall show allprofiles state 2>nul
echo -- Firewall outbound block rules (summary) --
netsh advfirewall firewall show rule name=all | findstr /I /C:"Block" 2>nul
REM -- WinRM / Remote Management --
REM WinRM checks commented out per user request; enabling WinRM requires admin actions and firewall changes
REM winrm quickconfig 2>nul
echo
REM SECTION: services and scheduled tasks (summary)
echo -- Services summary --
sc query state= all | findstr /I /C:"SERVICE_NAME" /C:"DISPLAY_NAME" 2>nul
echo -- Scheduled tasks (verbose list) --
schtasks /query /fo LIST /v 2>nul
echo
REM SECTION: user rights and elevation
echo -- User rights --
whoami /groups
net session >nul 2>&1 && echo ELEVATED || echo NOT_ELEVATED
echo
REM SECTION: PATH search sample
echo -- PATH search sample --
where cmd 2>nul
where powershell 2>nul
where curl 2>nul
echo
REM SECTION: driver summary
echo -- Driver query (brief) --
driverquery /fo table /v 2>nul | findstr /I /C:"Driver" /C:"State" || echo driverquery not available
echo
REM ---------- msinfo32 with spinner and timeout using temporary PS script ----------
echo SECTION: msinfo32 brief report (may take a while)
set "MSINFO_TXT=%TEMP%\msinfo_report.txt"
if exist "%MSINFO_TXT%" del "%MSINFO_TXT%" >nul 2>&1
echo Running msinfo32 (may take up to %MSINFO_TIMEOUT% seconds)... please wait
:: create temporary PowerShell script (ASCII-safe)
set "PS1=%TEMP%\diag_msinfo_wrapper.ps1"
> "%PS1%" (
echo $out = "%MSINFO_TXT%"
echo $timeout = %MSINFO_TIMEOUT%
echo $p = Start-Process -FilePath "msinfo32.exe" -ArgumentList "/report",$out -PassThru
echo $sw = [Diagnostics.Stopwatch]::StartNew()
echo while(-not (Test-Path $out) -and $sw.Elapsed.TotalSeconds -lt $timeout) {
echo Write-Host -NoNewline "."
echo Start-Sleep -Seconds 1
echo }
echo Write-Host ""
echo if(Test-Path $out) {
echo Write-Output "--- start msinfo32 report ---"
echo Get-Content -Path $out ^| Select-String -Pattern "^(System Model|System Manufacturer|BIOS Version|BIOS Date|OS Name|OS Version|System Type|Total Physical Memory|Available Physical Memory)" -SimpleMatch
echo Write-Output "--- end msinfo32 report ---"
echo } else {
echo Write-Output ("msinfo32 timed out after " + $timeout + " seconds; killing msinfo32 and showing compact WMI fallback")
echo try { Stop-Process -Id $p.Id -Force -ErrorAction SilentlyContinue } catch {}
echo $f = Get-CimInstance Win32_ComputerSystem
echo $b = Get-CimInstance Win32_BIOS
echo Write-Output ("System Manufacturer: " + $f.Manufacturer)
echo Write-Output ("System Model: " + $f.Model)
echo Write-Output ("System Type: " + $f.SystemType)
echo Write-Output ("Total Physical Memory: " + ([math]::Round($f.TotalPhysicalMemory/1MB)) + " MB")
echo Write-Output ("BIOS Version: " + $b.SMBIOSBIOSVersion)
echo Write-Output ("BIOS Date: " + $b.ReleaseDate)
echo }
)
:: run the temporary PowerShell script
powershell -NoProfile -ExecutionPolicy Bypass -File "%PS1%"
:: remove the temporary PowerShell script
del "%PS1%" >nul 2>&1
echo
REM SECTION: PowerShell Get-ComputerInfo selected fields
echo -- Get-ComputerInfo selected fields --
powershell -NoProfile -Command ^
" $ci = Get-ComputerInfo; ^
$props = 'CsName','WindowsProductName','WindowsVersion','OsBuildNumber','OsArchitecture','OsHotFixes','CsManufacturer','CsModel','CsSystemType','BiosManufacturer','BiosVersion','BiosReleaseDate','CsProcessors','CsTotalPhysicalMemory'; ^
foreach($p in $props) { if($ci.$p -ne $null) { Write-Output ($p + ': ' + ($ci.$p -join ', ')) } } " 2>nul || echo Get-ComputerInfo not available
echo
REM SECTION: Secure Boot and virtualization
echo -- Secure Boot and virtualization --
powershell -NoProfile -Command "if (Get-ItemProperty -Path HKLM:\\SYSTEM\\CurrentControlSet\\Control\\SecureBoot\\State -Name UEFISecureBootEnabled -ErrorAction SilentlyContinue) { Write-Output 'SecureBoot: Enabled' } else { Write-Output 'SecureBoot: Disabled or not supported' }" 2>nul || echo SecureBoot check not available
powershell -NoProfile -Command "Get-CimInstance Win32_ComputerSystem | Select-Object -Property HypervisorPresent,TotalPhysicalMemory" 2>nul || echo virtualization info not available
echo
REM SECTION: important environment variables
echo USERNAME = %USERNAME%
echo USERDOMAIN = %USERDOMAIN%
echo COMPUTERNAME = %COMPUTERNAME%
echo HOMEDRIVE = %HOMEDRIVE%
echo HOMEPATH = %HOMEPATH%
echo USERPROFILE = %USERPROFILE%
echo LOCALAPPDATA = %LOCALAPPDATA%
echo PROGRAMFILES = %PROGRAMFILES%
echo PROGRAMFILES(X86) = %PROGRAMFILES(X86)%
echo PROGRAMDATA = %PROGRAMDATA%
echo PATH = %PATH%
echo
REM SECTION: script context and permissions
echo current directory = %CD%
echo script fullpath = %~f0
echo script drive = %~d0
echo script folder = %~dp0
echo args = %*
icacls "%LOGDIR%" 2>nul || echo icacls unavailable
echo
REM SECTION: final notes and guidance for readers
echo -- Notes --
echo 1) This script writes the final log as UTF-8 without BOM so modern tools can parse it.
echo 2) Save this batch file ANSI or UTF-8 without BOM to avoid BOM artifacts in cmd display.
echo 3) msinfo32 may take up to %MSINFO_TIMEOUT% seconds; the script shows a dot spinner and falls back to a WMI summary if timed out.
echo 4) TARGET_HTTP and TARGET_PING are configurable at the top of this file.
echo 5) If you attach the produced log, include the first 30 lines and any error sections.
echo
echo Please attach the produced log file sysinfo%LOGSTAMP%.log when asking for help.
echo ==============================================
exit /b
sysinfo.batWhy write a batch when free Speccy will do the job and save info in a file ? --- Synchronet 3.21a-Linux NewsLink 1.2
Why write a batch when free Speccy will do the job and save info in a file ?
Marion wrote on 9/27/2025 2:44 PM:
sysinfo.bat
Outputs desired system information to console & to a timestamped log file. >>
This sysinfo.bat file outputs on my system everything I can think of
that doesn't require elevation. What's missing that you would want?
@echo off
REM Purpose: Outputs system information
REM sysinfo.bat (version 1.0 20250922) output system information
REM sysinfo.bat (version 1.1 20250923) added msinfo32 wrapper
REM sysinfo.bat (version 1.2 20250924) added hotfixes & installed programs,
REM firewall, winrm, secureboot, driver checks & write test >> REM sysinfo.bat (version 1.3 20250925) added driverquery, secureboot
REM virtualization checks & directory existence/writability checks
REM sysinfo.bat (version 1.4 20250927) commented out WinRM checks
REM as they required elevated permissions. Kept all else.
REM Usage: double-click, Win+R, or run from cmd.
REM Outputs timestamped log (e.g., C:\data\sys\log\sysinfo20250927_123456.log)
REM Comment linelength limit ===================================================
:: CONFIGURATION
set MSINFO_TIMEOUT=60 REM seconds to wait for msinfo32 before fallback >> set TARGET_HTTP=example.com
set TARGET_PING=8.8.8.8
set "LOGDIR=C:\data\sys\log" REM change if you prefer another directory >>
if "%1"=="__LOGGING__" goto :run_script
:: build timestamp (locale-safe for Windows 10)
for /f "tokens=1-4 delims=/ " %%a in ("%DATE%") do (
set DOW=%%a
set MM=%%b
set DD=%%c
set YYYY=%%d
)
for /f "tokens=1-3 delims=:." %%a in ("%TIME%") do (
set HH=%%a
set Min=%%b
set Sec=%%c
)
if "%HH:~0,1%"==" " set HH=0%HH:~1,1%
set LOGSTAMP=%YYYY%%MM%%DD%_%HH%%Min%%Sec%
set "LOGFILE=%LOGDIR%\sysinfo%LOGSTAMP%.log"
set "TMPTXT=%LOGDIR%\sysinfo%LOGSTAMP%.tmp"
:: Ensure required directories exist (creates LOGDIR and parents if needed)
if not exist "%LOGDIR%" (
md "%LOGDIR%" 2>nul
if errorlevel 1 echo WARNING: failed to create %LOGDIR%
)
:: Stream the second invocation live; Tee-Object writes an intermediate text file
powershell -NoProfile -Command ^
" & { & cmd /c '\"%~f0\" __LOGGING__' 2>&1 | Tee-Object -FilePath '%TMPTXT%' }"
:: Convert intermediate file to UTF-8 without BOM and remove temp
powershell -NoProfile -Command ^
" [System.IO.File]::WriteAllText('%LOGFILE%', (Get-Content -Raw -LiteralPath '%TMPTXT%'), (New-Object System.Text.UTF8Encoding($false))); Remove-Item -LiteralPath '%TMPTXT%' -ErrorAction SilentlyContinue"
echo.
echo Log created at %LOGFILE%
echo.
pause
exit /b
:run_script
echo [%DATE% %TIME%] sysinfo starting...
echo ==============================================
REM SECTION: invocation and basic info
echo script = %~f0
echo args = %*
echo COMSPEC = %COMSPEC%
echo current user = %USERNAME%\%USERDOMAIN%
echo user profile = %USERPROFILE%
echo local appdata = %LOCALAPPDATA%
echo temp = %TEMP%
echo
REM SECTION: ensure directories needed and test writability
REM Ensure the log directory exists and is writable by this user
echo -- Directory checks --
echo LOGDIR = %LOGDIR%
if exist "%LOGDIR%" ( echo LOGDIR exists ) else ( echo LOGDIR missing ) >> echo -- test write access to LOGDIR --
> "%LOGDIR%\._sysinfo_dir_test" echo OK 2>nul || echo write test failed for %LOGDIR%
if exist "%LOGDIR%\._sysinfo_dir_test" del "%LOGDIR%\._sysinfo_dir_test" >nul 2>nul
echo REM If the write test fails, logs may not be saved.
echo
REM SECTION: OS and system info
echo -- OS basic --
ver
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Boot Time" 2>nul || systeminfo | findstr /I "OS" 2>nul
echo
REM SECTION: Powershell and path
echo -- PowerShell and execution policy --
where powershell 2>nul || echo powershell NOTFOUND
powershell -NoProfile -Command "$PSVersionTable.PSVersion; Get-ExecutionPolicy -List" 2>nul || echo PowerShell info not available
echo
REM SECTION: environment and PATH
echo -- Environment variables --
echo PATH = %PATH%
echo PROGRAMFILES = %PROGRAMFILES%
echo PROGRAMFILES(X86) = %PROGRAMFILES(X86)%
echo PROGRAMDATA = %PROGRAMDATA%
echo TEMP = %TEMP%
echo
REM SECTION: filesystem and free space
echo -- Filesystem free space --
wmic logicaldisk get name,freespace,filesystem 2>nul
echo
REM SECTION: code page and locale
echo -- Code page and locale --
chcp
powershell -NoProfile -Command "[System.Globalization.CultureInfo]::InstalledUICulture.DisplayName" 2>nul
echo
REM SECTION: networking basics
echo -- Networking: adapters, routes, listeners --
ipconfig /all
echo ------------------------
route print
echo ------------------------
netstat -ano
echo ------------------------
echo -- DNS/HTTP check --
nslookup %TARGET_HTTP%
echo ------------------------
ping -n 4 %TARGET_PING%
echo
REM SECTION: proxy and WinHTTP settings
echo -- Proxy and WinHTTP --
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable 2>nul
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer 2>nul
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL 2>nul
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoDetect 2>nul
echo netsh winhttp show proxy
netsh winhttp show proxy
echo
REM SECTION: installed tools and versions
echo -- Installed tools (where/versions if present) --
where curl 2>nul || echo curl NOTFOUND
where git 2>nul || echo git NOTFOUND
where python 2>nul || echo python NOTFOUND
where node 2>nul || echo node NOTFOUND
where gvim 2>nul || echo gvim NOTFOUND
echo
where curl 2>nul && curl -s --version 2>nul || echo curl version unknown >> echo
REM SECTION: installed hotfixes and programs
echo -- Installed hotfixes (quick list) --
wmic qfe get HotFixID,InstalledOn 2>nul || echo qfe list not available
echo
echo -- Installed programs (registry uninstall keys, compact) --
reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" /s /v DisplayName 2>nul | findstr /I /C:"DisplayName" || echo no registry uninstall info
echo
REM SECTION: firewall and remote config
echo -- Windows Firewall state --
netsh advfirewall show allprofiles state 2>nul
echo -- Firewall outbound block rules (summary) --
netsh advfirewall firewall show rule name=all | findstr /I /C:"Block" 2>nul
REM -- WinRM / Remote Management --
REM WinRM checks commented out per user request; enabling WinRM requires admin actions and firewall changes
REM winrm quickconfig 2>nul
echo
REM SECTION: services and scheduled tasks (summary)
echo -- Services summary --
sc query state= all | findstr /I /C:"SERVICE_NAME" /C:"DISPLAY_NAME" 2>nul
echo -- Scheduled tasks (verbose list) --
schtasks /query /fo LIST /v 2>nul
echo
REM SECTION: user rights and elevation
echo -- User rights --
whoami /groups
net session >nul 2>&1 && echo ELEVATED || echo NOT_ELEVATED
echo
REM SECTION: PATH search sample
echo -- PATH search sample --
where cmd 2>nul
where powershell 2>nul
where curl 2>nul
echo
REM SECTION: driver summary
echo -- Driver query (brief) --
driverquery /fo table /v 2>nul | findstr /I /C:"Driver" /C:"State" || echo driverquery not available
echo
REM ---------- msinfo32 with spinner and timeout using temporary PS script ----------
echo SECTION: msinfo32 brief report (may take a while)
set "MSINFO_TXT=%TEMP%\msinfo_report.txt"
if exist "%MSINFO_TXT%" del "%MSINFO_TXT%" >nul 2>&1
echo Running msinfo32 (may take up to %MSINFO_TIMEOUT% seconds)... please wait
:: create temporary PowerShell script (ASCII-safe)
set "PS1=%TEMP%\diag_msinfo_wrapper.ps1"
> "%PS1%" (
echo $out = "%MSINFO_TXT%"
echo $timeout = %MSINFO_TIMEOUT%
echo $p = Start-Process -FilePath "msinfo32.exe" -ArgumentList "/report",$out -PassThru
echo $sw = [Diagnostics.Stopwatch]::StartNew()
echo while(-not (Test-Path $out) -and $sw.Elapsed.TotalSeconds -lt $timeout) {
echo Write-Host -NoNewline "."
echo Start-Sleep -Seconds 1
echo }
echo Write-Host ""
echo if(Test-Path $out) {
echo Write-Output "--- start msinfo32 report ---"
echo Get-Content -Path $out ^| Select-String -Pattern "^(System Model|System Manufacturer|BIOS Version|BIOS Date|OS Name|OS Version|System Type|Total Physical Memory|Available Physical Memory)" -SimpleMatch
echo Write-Output "--- end msinfo32 report ---"
echo } else {
echo Write-Output ("msinfo32 timed out after " + $timeout + " seconds; killing msinfo32 and showing compact WMI fallback")
echo try { Stop-Process -Id $p.Id -Force -ErrorAction SilentlyContinue } catch {}
echo $f = Get-CimInstance Win32_ComputerSystem
echo $b = Get-CimInstance Win32_BIOS
echo Write-Output ("System Manufacturer: " + $f.Manufacturer)
echo Write-Output ("System Model: " + $f.Model)
echo Write-Output ("System Type: " + $f.SystemType)
echo Write-Output ("Total Physical Memory: " + ([math]::Round($f.TotalPhysicalMemory/1MB)) + " MB")
echo Write-Output ("BIOS Version: " + $b.SMBIOSBIOSVersion)
echo Write-Output ("BIOS Date: " + $b.ReleaseDate)
echo }
)
:: run the temporary PowerShell script
powershell -NoProfile -ExecutionPolicy Bypass -File "%PS1%"
:: remove the temporary PowerShell script
del "%PS1%" >nul 2>&1
echo
REM SECTION: PowerShell Get-ComputerInfo selected fields
echo -- Get-ComputerInfo selected fields --
powershell -NoProfile -Command ^
" $ci = Get-ComputerInfo; ^
$props = 'CsName','WindowsProductName','WindowsVersion','OsBuildNumber','OsArchitecture','OsHotFixes','CsManufacturer','CsModel','CsSystemType','BiosManufacturer','BiosVersion','BiosReleaseDate','CsProcessors','CsTotalPhysicalMemory'; ^
foreach($p in $props) { if($ci.$p -ne $null) { Write-Output ($p + ': ' + ($ci.$p -join ', ')) } } " 2>nul || echo Get-ComputerInfo not available
echo
REM SECTION: Secure Boot and virtualization
echo -- Secure Boot and virtualization --
powershell -NoProfile -Command "if (Get-ItemProperty -Path HKLM:\\SYSTEM\\CurrentControlSet\\Control\\SecureBoot\\State -Name UEFISecureBootEnabled -ErrorAction SilentlyContinue) { Write-Output 'SecureBoot: Enabled' } else { Write-Output 'SecureBoot: Disabled or not supported' }" 2>nul || echo SecureBoot check not available
powershell -NoProfile -Command "Get-CimInstance Win32_ComputerSystem | Select-Object -Property HypervisorPresent,TotalPhysicalMemory" 2>nul || echo virtualization info not available
echo
REM SECTION: important environment variables
echo USERNAME = %USERNAME%
echo USERDOMAIN = %USERDOMAIN%
echo COMPUTERNAME = %COMPUTERNAME%
echo HOMEDRIVE = %HOMEDRIVE%
echo HOMEPATH = %HOMEPATH%
echo USERPROFILE = %USERPROFILE%
echo LOCALAPPDATA = %LOCALAPPDATA%
echo PROGRAMFILES = %PROGRAMFILES%
echo PROGRAMFILES(X86) = %PROGRAMFILES(X86)%
echo PROGRAMDATA = %PROGRAMDATA%
echo PATH = %PATH%
echo
REM SECTION: script context and permissions
echo current directory = %CD%
echo script fullpath = %~f0
echo script drive = %~d0
echo script folder = %~dp0
echo args = %*
icacls "%LOGDIR%" 2>nul || echo icacls unavailable
echo
REM SECTION: final notes and guidance for readers
echo -- Notes --
echo 1) This script writes the final log as UTF-8 without BOM so modern tools can parse it.
echo 2) Save this batch file ANSI or UTF-8 without BOM to avoid BOM artifacts in cmd display.
echo 3) msinfo32 may take up to %MSINFO_TIMEOUT% seconds; the script shows a dot spinner and falls back to a WMI summary if timed out.
echo 4) TARGET_HTTP and TARGET_PING are configurable at the top of this file.
echo 5) If you attach the produced log, include the first 30 lines and any error sections.
echo
echo Please attach the produced log file sysinfo%LOGSTAMP%.log when asking for help.
echo ==============================================
exit /b
I dunno man, but there sure are a lot of echoes in there :)
I dunno man, but there sure are a lot of echoes in there :)It's a bit wordy. To see the info I have to scroll forever. I guess I could pipe it to
more.