Sign in to follow this  
Followers 0
eri

Set Value File Size..

7 posts in this topic

How to Set Value size 0 ~ 500 Kb in this script..

ceksize()
 Func ceksize()
    $location = @ScriptDir &"\sample.exe"
    $size = FileGetSize($location)
   If $size = (0~500 kb) Then ; File Size 0 kb ~ 500 kb
      MsgBox(0,"Info","Ok This Application Compatible With Your Application")
   Else
      MsgBox(0,"Info","This Application Not Compatible With Your Application")
   EndIf
 EndFunc

if file size 0~500 kb OK..

if file size bigger than 500 kb Exit..

Share this post


Link to post
Share on other sites



Next time i would advice you to use ConsoleWrite if you not sure what variable it gives and why you dont get what you want. In this situation you could use ConsoleWrite("Size = " & $size & @CRLF), so you could notice, that result is in Bytes and if you want to compare with [KB], you just need to do as it was replyed by other person.

Share this post


Link to post
Share on other sites

If $size <= 500 * 1024 Then

Thank`s Yashied..

500 * 1024 <=== what means 1024 ? why not 1000..? :idea:

Share this post


Link to post
Share on other sites

Next time i would advice you to use ConsoleWrite if you not sure what variable it gives and why you dont get what you want. In this situation you could use ConsoleWrite("Size = " & $size & @CRLF), so you could notice, that result is in Bytes and if you want to compare with [KB], you just need to do as it was replyed by other person.

Thannk`s Makaule.. I will try later..

Share this post


Link to post
Share on other sites

Thank`s Yashied..

500 * 1024 <=== what means 1024 ? why not 1000..? :idea:

1Kb = 1024 bytes?

Share this post


Link to post
Share on other sites

All computer data is stored in binary, therefore any measurement must be a power of 2.

210 = 1024 bytes = 1 KB

220 = 1048576 bytes = 1 MB

...etc...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0