This command is amazing and just what I need. Thank you to who have written it.
I made a bat file that shows all PC details on one screen.... So when I use this command in my bat file it keeps closing.... I have used paused cmd /k etc. etc. and dont work
for /f "tokens=1-3" %a in ('WMIC LOGICALDISK GET FreeSpace^,Name^,Size ^|FINDSTR /I /V "Name"') do @echo wsh.echo "%b" ^& " free=" ^& FormatNumber^(cdbl^(%a^)/1024/1024/1024, 2^)^& " GiB"^& " size=" ^& FormatNumber^(cdbl^(%c^)/1024/1024/1024, 2^)^& " GiB" > %temp%\tmp.vbs & @if not "%c"=="" @echo( & @cscript //nologo %temp%\tmp.vbs & del %temp%\tmp.vbs
Below is the command I have and want to run the above disk space check together with mine in one screen without closing the cmd box
@color 1F
@echo off
wmic.exe BIOS Get Manufacturer,SERIALNUMBER && wmic baseboard get product,serialnumber && WMIC CSPRODUCT GET NAME,version && hostname && ipconfig | find /i "IPv4" && echo %username%
systeminfo | findstr /c:"Domain"
systeminfo | findstr /c:"OS Name"
systeminfo | findstr /c:"OS Version"
systeminfo | findstr /c:"System type"
systeminfo | findstr /c:"Total Physical Memory"
wmic cpu get name
THIS LINE i WANT THE COMMAND THAT SHOWS THE HDD'S, FREE SPACE, SIZE IN GB PLEASE :)
%
symbols need to be escaped (Doubled) for metavariables such as For loop variables; So%%a
instead of%a
,%%b
not%b
etcsysteminfo
takes a long time, so don't execute it five times.findstr
is able to search for mutliple strings in one go:systeminfo |findstr /c:"Domain" /c:"OS Name" /c:"OS Version" /c:<etc>