Ok,I have this code:
echo [%time%] Beginning install
echo [%time%] Checking hard drive C:\
for /f "usebackq tokens=* delims=" %%# in (`"wmic logicaldisk where name='C:' get FreeSpace /format:value"`) do (
for /f "tokens=* delims=" %%a in ("%%#") do @set "%%a"
)
echo [%time%] Available space: %freespace% Bytes
echo [%time%] Required space: 34 Megabytes
@set requiredspace=34
@set /a "available_required=%freespace%-%requiredspace%"
echo [%time%] %available_required%
pause
It finds the available storage on a hard drive and takes away the required to find out if there is enough storage to complete the install, unfortunately, Windows CMD doesn't like numbers higher than 32 bit so I need to cut it down to megabytes, the maths cant be done on the stored variable so It has to be found directly from the command. For example, (Obviously not working though)
"wmic logicaldisk where name='C:' get FreeSpace /format:value /division:megabytes"
Thanks