Creating a script to gather PC information - to assist those asking for help
Posted: 10 Aug 2016 23:20
I'm asking for help here: this script provides essential information so that volunteer helpers have information about a question writer's computer.
Help would be welcomed to think of extra details to add.
aGerman and I have had discussion regarding this and here is the result so far: some extra samples from more computers would be valuable too. There could be bugs lurking here...
//EDIT: Latest Update -> viewtopic.php?f=3&t=11287
pagefile.sys was chosen for the DIR format as it provides the last boot time of the computer and an indication of the amount of virtual memory.
The script
Help would be welcomed to think of extra details to add.
aGerman and I have had discussion regarding this and here is the result so far: some extra samples from more computers would be valuable too. There could be bugs lurking here...
//EDIT: Latest Update -> viewtopic.php?f=3&t=11287
Code: Select all
Windows version: Microsoft Windows [Version 6.3.9600]
Product name: Windows 8.1 Pro with Media Center
Processor arch: x86 and 32 bit Windows
Date format: dd/mm/yy = Wed 10/08/2016
Time format: 24 hours = 14:09:50.35
Extensions: system:Enabled user:Enabled
Delayed expansion: system:Disabled user:Disabled
Locale name: en-AU Code Pages: OEM 850 ANSI 1252
DIR format: 06/08/2016 20:36 3,484,418,048 pagefile.sys
The script
Code: Select all
@echo off &setlocal EnableExtensions DisableDelayedExpansion
set "International=HKCU\Control Panel\International"
set "CurrentVersion=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
set "CodePage=HKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePage"
set "CMDproc=Software\Microsoft\Command Processor"
set bitness=32
if exist "%SystemRoot%\SysWOW64\" set bitness=64
for /f "tokens=1,2,*" %%a in ('reg query "%International%"^|find "REG_"') do set "%%a=%%c"
if "%iDate%"=="0" (set format=mm/dd/yy) else if "%iDate%"=="1" (set format=dd/mm/yy) else if "%iDate%"=="2" (set format=yy/mm/dd)
if "%iTime%"=="0" (set hours=12) else if "%iTime%"=="1" (set hours=24)
for /f "delims=" %%a in ('dir "%SystemDrive%\pagefile.sys" /a ^|find ":"') do set DirFormat=%%a
for %%a in (es eu ds du) do set "%%a=Disabled"
reg query "HKLM\%CMDproc%" /v "EnableExtensions" 2>nul|find "0x1">nul && set "es=Enabled "
reg query "HKCU\%CMDproc%" /v "EnableExtensions" 2>nul|find "0x1">nul && set "eu=Enabled "
reg query "HKLM\%CMDproc%" /v "DelayedExpansion" 2>nul|find "0x1">nul && set "ds=Enabled "
reg query "HKCU\%CMDproc%" /v "DelayedExpansion" 2>nul|find "0x1">nul && set "du=Enabled "
>"%temp%\info.txt" (
echo [code^]
for /f "delims=" %%a in ('ver') do echo Windows version: %%a
for /f "tokens=2*" %%a in ('
reg query "%CurrentVersion%"^|find /i "ProductName"') do echo Product name: %%b
echo Processor arch: %PROCESSOR_ARCHITECTURE% and %Bitness% bit Windows&echo(
echo Date format: %format% = %date%
echo Time format: %hours% hours = %time%
for /f "tokens=3" %%a in ('reg query "%CodePage%" /v "OEMCP"') do (
for /f "tokens=3" %%b in ('reg query "%CodePage%" /v "ACP"') do (
echo Extensions: system:%es% user:%eu%
echo Delayed expansion: system:%ds% user:%du%
echo Locale name: %LocaleName% Code Pages: OEM %%a ANSI %%b))
echo DIR format: %DirFormat%
echo [/code^]
)
clip >nul 2>&1 && clip < "%temp%\info.txt"
start "" notepad.exe "%temp%\info.txt"
>nul ping -n 2 localhost
del "%temp%\info.txt"