B
Bell,Nathan
All,
I am writing a cmd script and as a part of it I want it to check a file
size and do a zip+split if larger than a certain size (3.8GB) otherwise do
just a zip. When I try to store the filesize variable on anything that is a
large file i.e: 3.8GB I get an "Invalid number, numbers must be less than
32bits of precision" error, which to me means that the number is too big but
I don't see how I can convert it to something smaller. I tried dividing it
first (to get MB instead of bytes, but that did not work either. Can anyone
assist? Here is the script:
@echo off
REM %1 = path to filename (source)
REM %2 = zip file name (target)
REM %3 = zip split filename (target)
REM %4 = password for zip file
SET/a filesize=%~z1
REM echo %filesize% MB
REM pause
U:
CD\mssql$b\backup\dbextraction
IF %filesize% GTR 4101253364 (goto:zipsplit) else (goto:zip)
goto:eof
:zipsplit
echo ***ZIPSplittingfile***
wzzip -s%4 %2 %1
wzzip -ys3984589 %2 %3
pause
goto:eof
:zip
echo ***Zippingfile***
wzzip -s%4 %2 %1
pause
goto:eof
I am writing a cmd script and as a part of it I want it to check a file
size and do a zip+split if larger than a certain size (3.8GB) otherwise do
just a zip. When I try to store the filesize variable on anything that is a
large file i.e: 3.8GB I get an "Invalid number, numbers must be less than
32bits of precision" error, which to me means that the number is too big but
I don't see how I can convert it to something smaller. I tried dividing it
first (to get MB instead of bytes, but that did not work either. Can anyone
assist? Here is the script:
@echo off
REM %1 = path to filename (source)
REM %2 = zip file name (target)
REM %3 = zip split filename (target)
REM %4 = password for zip file
SET/a filesize=%~z1
REM echo %filesize% MB
REM pause
U:
CD\mssql$b\backup\dbextraction
IF %filesize% GTR 4101253364 (goto:zipsplit) else (goto:zip)
goto:eof
:zipsplit
echo ***ZIPSplittingfile***
wzzip -s%4 %2 %1
wzzip -ys3984589 %2 %3
pause
goto:eof
:zip
echo ***Zippingfile***
wzzip -s%4 %2 %1
pause
goto:eof