How can I check the size of a file in a Windows ba

2019-01-05 00:11发布

I want to have a batch file which checks what the filesize is of a file.

If it is bigger than %somany% kbytes, it should redirect with GOTO to somewhere else.

Example:

[check for filesize]
IF %file% [filesize thing Bigger than] GOTO No
echo Great! Your filesize is smaller than %somany% kbytes.
pause
exit
:no
echo Um... You have a big filesize.
pause
exit

13条回答
我欲成王,谁敢阻挡
2楼-- · 2019-01-05 00:47

Just an idea:

You may get the filesize by running command "dir":

>dir thing

Then again it returns so many things.

Maybe you can get it from there if you look for it.

But I am not sure.

查看更多
登录 后发表回答