fsutil

FSUTIL in GB space left

僤鯓⒐⒋嵵緔 提交于 2019-12-02 15:15:11
问题 I got a batch file that does the following. echo Server 1 C:\>>output.txt fsutil volume diskfree \\IPISHERE\d$>>output.txt echo ---------------------------------------------------------- >>output.txt This then displays data as Total # of free bytes : 71942455296 Total # of bytes : 131623546880 Total # of avail free bytes : 71942455296 Please can some one help so I can convert it in to GBs? 回答1: @echo off setlocal EnableDelayedExpansion for /F "tokens=1* delims=:" %%a in ('fsutil volume

FSUTIL in GB space left

时光总嘲笑我的痴心妄想 提交于 2019-12-02 11:35:16
I got a batch file that does the following. echo Server 1 C:\>>output.txt fsutil volume diskfree \\IPISHERE\d$>>output.txt echo ---------------------------------------------------------- >>output.txt This then displays data as Total # of free bytes : 71942455296 Total # of bytes : 131623546880 Total # of avail free bytes : 71942455296 Please can some one help so I can convert it in to GBs? @echo off setlocal EnableDelayedExpansion for /F "tokens=1* delims=:" %%a in ('fsutil volume diskfree C:') do for %%c in (%%b) do ( set "D=%%c" set /A "D1=!D:~0,-8!,D2=1!D:~-8,-4!-10000,D3=1!D:~-4!-10000"