윈도우 포럼의 지후빠님 스크립트를 활용했습니다.
첨부 파일에는 관리자 권한 구문이 없습니다.
bcdedit >nul||(powershell start -verb runas '%0'&exit)
==========================================================
@echo off
bcdedit >nul||(powershell start -verb runas '%0'&exit)
setlocal enabledelayedexpansion
title Disk Information
cd /d %~dp0
call :Disk-info
echo( &echo(
timeout 10
call :Drive-info
pause >nul &exit
:Drive-info
mode con cols=58 lines=45
setlocal enabledelayedexpansion
chcp 65001 >nul
set "GB=1073837824"
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)
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(
echo([97m%1\ %size:~-10%GB[0m
for /l %%i in (1 1 %nUsed%) do <nul set /p "=[92m━[0m"
for /l %%i in (1 1 %nFree%) do <nul set /p "=[90m━[0m"
echo(
echo([92m%used:~-10%GB 사용[0m [90m%free:~-10%GB 사용 가능[0m
goto :eof
:Disk-info
setlocal enabledelayedexpansion
title Disk Information
cd /d %~dp0
mode con cols=90 lines=30
set "spc= "
set DetailDisk="%temp%\seldis.detdis"& break>!DetailDisk!
for /f "tokens=2*" %%a in ('echo lis dis^|diskpart') do (
for /f "delims=0123456789" %%# in ("%%a ") do if "%%#"==" " (set DISK_%%a_=%%a
(echo sel dis %%a& echo det dis)>>%DetailDisk%
set #=%%b& if "!#:~-1!"=="*" (set GM%%a=GPT) else set GM%%a=MBR
for /f "tokens=2 delims=`" %%$ in ("!#: =`!") do set SZ%%a= %%$)
)
for /f "tokens=1*" %%a in ('diskpart /s %DetailDisk%') do (
if !cap!==on set "HW!#!=%%a %%b"& set cap=off
for /f "delims=0123456789" %%# in ("%%a ") do if "%%#"==" " set #=%%a&set PT!#!=0&set PTL!#!= &set cap=on
for /f "tokens=1*" %%c in ("%%b") do for /f "delims=0123456789" %%# in ("%%c ") do (
if "%%#"==" " set /a PT!#!+=1 & set $=%%b& call set PTL!#!=%%PTL!#!%%!$:~5,3!)
)
set bar= [40m--------------------------------------------------------------------------------[0m
echo.
echo.[5m%spc%Disk No Type Size Part Let Model[0m& echo %bar%
for /f "tokens=2 delims=_" %%a in ('set Disk_') do (
set PTL=!PTL%%a: =! & set PTL=!PTL:~0,1! !PTL:~1,1! !PTL:~2,1! !PTL:~3,1!
echo [1m%spc%Disk %%a !GM%%a! !SZ%%a:~-9! !PT%%a![0m [96m!PTL:~0,7![0m [1m!HW%%a![0m
echo %bar%
)
del %DetailDisk%
endlocal
===================================================================
'윈도우 관련' 카테고리의 다른 글
Imagx로 사용 중인 윈도우 백업 (0) | 2024.10.23 |
---|---|
Imagx로 사용 중인 윈도우 백업 (0) | 2024.09.25 |
OKR 엔진 (2) | 2024.08.22 |
Windows 11 26100.994 Pro (0) | 2024.07.01 |
실컴 로그인 암호 생성 또는 지우기 (0) | 2024.06.03 |