Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off &cls
- mode con: cols=200 lines=40 &color f0
- Setlocal
- :: - Get Optical Drive(s) Information -----------------------------------------------
- for /f "skip=2 tokens=2,3 delims=," %%i in (
- '%SystemRoot%\System32\wbem\wmic.exe logicaldisk where "drivetype=5" get Caption^ /format:csv'
- ) Do (
- set "optical_drive_letter=%%i"
- )
- for /f "tokens=2,3 delims=," %%a in (
- '%SystemRoot%\System32\wbem\wmic.exe cdrom where "mediatype!=11" get name^,mediatype /format:csv'
- ) Do (
- set "optical_drive_type=%%a"
- set "optical_drive_name=%%b"
- )
- ::echo( Volume %optical_drive_letter%\
- ::echo( %optical_drive_description%/%optical_drive_type% (%optical_drive_name%)
- :: ------------------------------------------------------------------------------
- echo( Volume %optical_drive_letter%\
- echo( %optical_drive_type% (%optical_drive_name%)
- echo(
- call :setESC
- call :hdd-info
- endlocal
- echo. Press any key to exit &>nul timeout /t -1 &exit /B
- REM - Setup ANSI Escape Character ------------------------------------------------
- :setESC
- for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
- set ESC=%%b
- exit /B 0
- )
- REM ------------------------------------------------------------------------------
- :: - Get Storage / HDD Info ------------------------------------------------------
- :hdd-info
- :: Enable use of Unicode symbols
- chcp 65001 >nul
- set "GB=1073741824"
- for /f "skip=1 delims=" %%i in ('%SystemRoot%\System32\wbem\wmic.exe logicaldisk get deviceid^,freespace^,size^') do (for /f "tokens=1-3" %%j in ("%%i") do call :output %%j %%k %%l)
- :: Disable Unicode symbols
- chcp 1252 >nul
- goto :eof
- :output
- if "%3"=="" (
- :: echo. Volume %optical_drive_letter%\ - %optical_drive_type% ^(%optical_drive_name%^)
- goto :eof
- )
- for /f "tokens=1-4" %%i in (
- 'mshta vbscript:Execute("CreateObject(""Scripting.FileSystemObject"").GetStandardStream(1).Write(FormatNumber(%3/%GB%, 2) & "" "" & FormatNumber((%3-%2)/%GB%, 2) & "" "" & FormatNumber(%2/%GB%, 2) & "" "" & Round((%3-%2)*50/%3)):Close"^)'
- ) do (
- set "size=%%i"
- set "used=%%j"
- set "free=%%k"
- set /a "nUsed=%%l, nFree=50-%%l"
- )
- echo( Volume %1\
- echo( Total Size : %size:~-10%GB
- echo( Used Space : %used:~-10%GB
- echo( Free Space : %free:~-10%GB
- for /l %%i in (1 1 %nUsed%) do <nul set /p "=%ESC%[91m▓%ESC%[30m"
- for /l %%i in (1 1 %nFree%) do <nul set /p "=%ESC%[92m▓%ESC%[30m"
- echo( &echo(
- goto :eof
- :: ------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement