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) >> OUTPUT\HardDriveInfo-%date%.csv
:END
echo %1%............................................Done.
goto :EOF
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) >> OUTPUT\HardDriveInfo-%date%.csv
:END
echo %1%............................................Done.
goto :EOF
___________________________________________________________________
Copy above code and paste it on notepad and save it as .bat file
create one Hosts.txt file put required computer list
Format to be followed @ Hosts.txt
IP1 or HOSTNAME1
IP2 or HOSTNAME2
.
.
.
.
create one Hosts.txt file put required computer list
Format to be followed @ Hosts.txt
IP1 or HOSTNAME1
IP2 or HOSTNAME2
.
.
.
.
Comments
Post a Comment