윈도우 관련

DiskInfo

집앞의 큰나무 2024. 9. 3. 05:28

윈도우 포럼의 지후빠님 스크립트를 활용했습니다.

첨부 파일에는 관리자 권한 구문이 없습니다.

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(%1\  %size:~-10%GB
for /l %%i in (1 1 %nUsed%) do <nul set /p "=━"
for /l %%i in (1 1 %nFree%) do <nul set /p "=━"
echo(
echo(%used:~-10%GB 사용  %free:~-10%GB 사용 가능
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= --------------------------------------------------------------------------------
echo. 
echo.%spc%Disk No   Type    Size      Part   Let      Model& 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 %spc%Disk %%a    !GM%%a!  !SZ%%a:~-9!     !PT%%a!     !PTL:~0,7!  !HW%%a!
  echo %bar%
)
del %DetailDisk%
endlocal

===================================================================

 

Diskinfo.cmd
0.00MB

'윈도우 관련' 카테고리의 다른 글

OKR 엔진  (2) 2024.08.22
Windows 11 26100.994 Pro  (0) 2024.07.01
실컴 로그인 암호 생성 또는 지우기  (0) 2024.06.03
Boot 저장 장치  (1) 2024.05.23
26100.461 Pro Administrator 무봉인  (1) 2024.05.06