Get System Info from Cmd


@echo off

echo #####   1. SYSTEM_INFO   ##### >>RS_System_Info.txt
systeminfo >>RS_System_Info.txt
echo. >>RS_System_Info.txt

echo #####   2. SERIAL_NUMBER   ##### >>RS_System_Info.txt
wmic bios get serialnumber >>RS_System_Info.txt
echo. >>RS_System_Info.txt
echo. >>RS_System_Info.txt

echo #####   3. HARD DISK   ##### >>RS_System_Info.txt
wmic diskdrive get model,serialNumber,size,status >>RS_System_Info.txt
echo. >>RS_System_Info.txt
echo. >>RS_System_Info.txt

echo #####   4. LOGIN USER   ##### >>RS_System_Info.txt
echo %username% >>RS_System_Info.txt
echo. >>RS_System_Info.txt

echo #####   5. USER LIST   ##### >>RS_System_Info.txt
net users >>RS_System_Info.txt
echo. >>RS_System_Info.txt

echo Thanks, please close the window.
RS_System_Info.txt
pause




Get the Make, Model, Serial Number, Hostname, and Login information, generate output in text file.
Copy and paste the below code in windows command prompt.

cls

@echo off

echo "Wait collecting Make, Model, Serial Number, Hostname, and Login Information."

del my_hostname.txt

PowerShell -Command "& {'1.>> Manufacturer: ' | Out-File my_hostname.txt -Append}"

PowerShell -Command "& {Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object Manufacturer | ForEach-Object{$_.Manufacturer} | Out-File my_hostname.txt -Append}"

PowerShell -Command "& {'2.>> Model: ' | Out-File my_hostname.txt -Append}"

PowerShell -Command "& {Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object Model | ForEach-Object{$_.Model} | Out-File my_hostname.txt -Append}"

PowerShell -Command "& {'3.>> Serial Number: ' | Out-File my_hostname.txt -Append}"

PowerShell -Command "& {Get-CimInstance -ClassName Win32_BIOS | Select-Object SerialNumber | ForEach-Object{$_.SerialNumber} | Out-File my_hostname.txt -Append}"

PowerShell -Command "& {'4.>> Hostname:' | Out-File my_hostname.txt -Append}"

PowerShell -Command "& {Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object Name | ForEach-Object{$_.Name} | Out-File my_hostname.txt -Append}"

PowerShell -Command "& {'5.>> Login: ' | Out-File my_hostname.txt -Append}"

PowerShell -Command "& {Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object UserName | ForEach-Object{$_.UserName} | Out-File my_hostname.txt -Append}"

PowerShell -Command "& {Start-Process notepad my_hostname.txt}

Previous Post Next Post