rem @echo off rem #######播磨CADサーバC,Dドライブの空き容量確認 070901 IT Morihiro.fukatsu setlocal enabledelayedexpansion net use Z: \\192.168.181.6\C$ net use X: \\192.168.181.6\D$ cd /d Z: for /f "skip=4 tokens=1-4 delims= " %%b in ('dir "*"') do ( if "%%c"=="個のディレクトリ" set moto=%%d ) for /f "tokens=1-4" %%a in ('echo %moto%') do set Aki=%%a%%b%%c%%d set keta=/%Aki% rem 999MB以下の場合 if %keta:~-10,1%==/ ( goto :C_NG ) rem 1GB以上の場合 if %keta:~-11,1%==/ ( set aaa=%Aki:~0,8% goto :C_OK1 ) rem 10GB以上の場合 if %keta:~-12,1%==/ ( goto :C_END ) :C_OK1 rem 4GB以下ならメッセージを送る set /a ccc = 90000000 rem echo %Aki% if %aaa% LEQ %ccc% ( goto :C_NG ) else ( goto :C_END ) :C_NG set errmsg=空き容量がありません UOPPIF01\C ⇒ 空き%moto%バイト net send 192.168.160.112 %errmsg% net send 192.168.160.116 %errmsg% net send 192.168.160.113 %errmsg% :C_END net use /YES /delete z: rem ####Dドライブチェック cd /d X: for /f "skip=4 tokens=1-4 delims= " %%b in ('dir "*"') do ( if "%%c"=="個のディレクトリ" set moto=%%d ) for /f "tokens=1-4" %%a in ('echo %moto%') do set Aki=%%a%%b%%c%%d set keta=/%Aki% rem 999MB以下の場合 if %keta:~-10,1%==/ ( goto :D_NG ) rem 1GB以上の場合 if %keta:~-11,1%==/ ( goto :D_NG ) rem 10GB以上の場合 if %keta:~-12,1%==/ ( set aaa=%Aki:~0,8% goto :D_OK1 ) :D_OK1 rem 10GB以下ならメッセージを送る set /a ccc = 10000000 rem echo %Aki% if %aaa% LEQ %ccc% ( goto :D_NG ) else ( goto :D_END ) :D_NG set errmsg=空き容量がありません UOPPIF01\D ⇒ 空き%moto%バイト net send 192.168.160.112 %errmsg% net send 192.168.160.116 %errmsg% net send 192.168.160.113 %errmsg% :D_END net use /YES /delete X: