Skip to main content

Posts

Showing posts from December, 2018

Disk Drive Info

Disk Drive Information of a Computer HARD_DRIVE_INFO.bat ____________________________________________________________________ @echo off md OUTPUT echo. echo Fetching data................. echo. @echo OFF for /f %%s in ('type "Hosts.txt"') do call :PROCESS %%s echo. echo Fetching is Complete. Please refer "OUTPUT\" for the data. echo. pause goto :END :PROCESS @echo off if %os%==Windows_NT goto WINNT :WINNT ( echo. echo %1%, Drive, Free Space, Total Size @echo off for /f "tokens=1-3" %%a in ('WMIC /node:%1 LOGICALDISK GET FreeSpace^,Name^,Size ^|FINDSTR /I /V "Name"') do @echo wsh.echo ",%%b," ^& FormatNumber^(cdbl^(%%a^)/1024/1024/1024, 2, , , vbFalse^)^& " GB," ^& FormatNumber^(cdbl^(%%c^)/1024/1024/1024, 2, , , vbFalse^)^& " GB" > %temp%\tmp.vbs & @if not "%%c"=="" @echo( & @cscript //nologo %temp%\tmp.vbs & del %temp%\tmp.vbs)  >> OUTP

Basic PC Info #Inventory

Batch Script  Simple .bat file to fetch quite useful info of Computer in a user friendly output format .csv PC-INFO.bat ---------------------------------------------------------------------------------------------------- @echo off md OUTPUT echo "%Date%" "%Time%"  >> Inventory.csv echo Hostname, System Model, Operating System, Service Pack, Graphics Card, RAM (MB), CPU, Hard Disk, Storage (Bytes), Current Logged in User, System Location, IPv4/IPv6  >> Inventory.csv echo " " >> Inventory.csv @echo OFF setlocal enableextensions for /f %%s in ('type "Hosts.txt"') do call :PROCESS %%s echo. echo Fetching is Complete. echo. echo " " >> Inventory.csv pause goto :END :PROCESS @echo off if %os%==Windows_NT goto WINNT goto NOCON :WINNT echo. echo -------------------------------------- REM set variables set hostname= set ip= set model= set osname= set sp= set cpu_name= set disk_drive= set storage= set g