In XP this works
"if %~z1 GTR 1000 ..."
But this doesn't work i NT. Does anyone have any idea how to get it to work in NT?
Actually, it wouldn't work in XP. You forgot the /I.
#1, I dunno /L bit this works in NT5:
=======================
@echo off
setLocal EnableDelayedExpansion
echo %~z1
if %~z1 GTR 10 echo biggger
========================
=====================================
If at first you don't succeed, you're about average.M2
Thanks! But it wont work in NT 4. This is returned: Invalid parameter to SETLOCAL command
The following usage of the path operator in batch-parameter
substitution is invalid: %~z1
For valid formats type CALL /? or FOR /?
=======================
@echo off
setLocal
echo %~z1
if %~z1 GTR 10 echo biggger
========================
=====================================
If at first you don't succeed, you're about average.M2
Thanks again :) That returned:
The following usage of the path operator in batch-parameter
substitution is invalid: %~z1
I'm not running NT4. I guess that ~Z won't fly You may need to use DIR and chop out the size. Before you go to the trouble, check and see if GTR works.
=====================================
If at first you don't succeed, you're about average.M2
I guess it wasn't urgent.
=====================================
If at first you don't succeed, you're about average.M2
hi, would Appreciate if you help me with below motioned script actually I am trying to write a batch file which can search *.avi and check if it is more than 200 MB restrict the file by using cacls or del the same. i m new with batch file and trying hard to get this done please help me
Thanks in advance.
@ECHO OFF
SET FILETYPE=*.mp3
SET SIZELIMIT=7,425,794
for /R d:\ %I IN ('%FILETYPE%') do set FILESIZE=%~xIif %FILESIZE% GTR %SIZELIMIT% (
del %SIZELIMIT%
) ELSE (
echo.file not found
)Shad