batch file - WMIC get physical memory -
hi have script gets system information , stores information system variable , parses detailed info flat text file in folder. information lets me know in company has type of windows, type of computer, , specs. thing missing getting total physical ram machine, making total physical ram system variable , getting detailed ram info such how many banks populated , how ram flat text file. here script, appreciated.
@if %debug%!==! echo on setlocal set prefix=%city%\%location%\computerlist\ /f "usebackq tokens=1,2 delims==|" %%i in (`wmic os name^,version /format:list`) 2>nul set "%%i=%%j" /f "tokens=2 delims==" %%i in ('wmic bios version /format:list') set "bios=%%i" /f "tokens=2 delims==" %%i in ('wmic computersystem model /format:list') set "model=%%i" ::for /f "tokens=2 delims==" %%i in (systeminfo |find "total physical memory" /format:list) set "memory=%%i" >>"%prefix%\%computername%.txt" echo os name: %name% >>"%prefix%\%computername%txt" echo os version: %version% >>"%prefix%\%computername%txt" echo pc model: %model% >>"%prefix%\%computername%txt" echo bios version: %bios% ::>>"%prefix%\%computername%txt" echo wmic memorychip banklabel, capacity, caption, devicelocator, partnumber if defined programfiles(x86) (set arch=x64) else set arch=x86 if "%name%" neq "%name:windows 8=%" ( set out=%prefix%\win8comps.txt ) else if "%name%" neq "%name:windows 7=%" ( set out=%prefix%\win7comps.txt ) else if "%name%" neq "%name:windows vista=%" ( set out=%prefix%\winvistacomps.txt ) else if "%name%" neq "%name:windows xp=%" ( set out=%prefix%\winxpcomps.txt ) >>"%out%" echo %computername% running %name% in %arch% environment :setx if exist "%windir%\system32\setx.exe" (goto language) else ( xcopy %city%\%location%\setx.exe %windir%\system32\setx.exe ) :install_language reg query "hklm\system\controlset001\control\nls\language" /v installlanguage | find "0409" > nul && set install_lang=english reg query "hklm\system\controlset001\control\nls\language" /v installlanguage | find "040c" > nul && set install_lang=french_standard reg query "hklm\system\controlset001\control\nls\language" /v installlanguage | find "0c0c" > nul && set install_lang=french_canadian :locale_language reg query "hklm\system\controlset001\control\nls\language" /ve | find "0409" > nul && set locale_lang=english reg query "hklm\system\controlset001\control\nls\language" /ve | find "0c0c" > nul && set locale_lang=french_standard :set_sys_variables setx -m os_name "%name%" setx -m architechture %arch% setx -m os_version %version% setx -m pc_model %model% setx -m bios_ver "%bios%" setx -m install_lang %install_lang% setx -m locale_lang %locale_lang% setx -m memory %memory%
@echo off setlocal /f "tokens=3*" %%i in ('systeminfo 2^>nul^|find "total physical memory"') set "memory=%%j" echo systeminfo: %memory% /f "delims=" %%i in ('wmic memphysical^|find "physical"') set "memory=%%i" %%i in (%memory:~139%) set memory=%%i&goto reportmem :reportmem echo wmic:%memory% goto :eof
run report:
from systeminfo: 7,678 mb wmic:8388608
so consistency - , i'm using .
decimal point, ,
thousands-separator...
Comments
Post a Comment