Web Development
5 replies
by muyideen
by beermonster
I'm not sure about 95/98, but this is definitely achievable in NT and win2k - I've used it to run on the fly disk space checks. an example is
for /F "skip=3 tokens=3,4" %%A in ('dir *.txt /-C') do call :go %%A %%B
rem NOTE the /-C tells dir not toput commas in the file size
goto end
:go
set /a size=%1
rem NOTE that the /a tells it that the variable is a number
IF %size% EQU 10000 echo %2 is bigger than 10000
rem NOTE other operators are LSS GTR NEQ
:end
This is only a suggested outline for your script. The dir command also returns a total bytes line that will be picked up which you will need to trap and ignore. I would suggest using
set fname=%2
IF /I %fname%=="bytes" goto end
Note that using %1 and %2 directly to do some processing can be flakey, which is why I have used the fname variable. If you need any help when writing your specific script then mail me at darthurs@hotmail.com
by muyideen
by muyideen
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending