I\'m using the below code to output the current free space on the C: Drive. How can I convert the output from bytes to GB using batch?
@echo off
for /f \"use
REM ECHO Disk Storage
for /f "tokens=1" %%d in (
'wmic logicaldisk where drivetype^=3 get deviceid ^| find ":"') do (
for /f "usebackq delims== tokens=2" %%x in (`wmic logicaldisk where "DeviceID='%%d'" get Size /value`) do set Size=%%x
echo VolumeSize on %%d Partition = !Size:~0,-10!,!Size:~2,-8! GB >output.txt
for /f "usebackq delims== tokens=2" %%x in (`wmic logicaldisk where "DeviceID='%%d'" get FreeSpace /value`) do set FreeSpace=%%x
echo Freespace on %%d Partition = !FreeSpace:~0,-10!,!FreeSpace:~2,-8! GB >> output.txt
echo.
)
)