I am using Windows 2000 and trying to create a batch file that will set a variable named "TOTFILES" to the number of files found in a folder called "c:\test". I then want it to output "GREATERTHAN4" if the number of files found in the folder is greater than 4.
Here is the test batch file I have been playing around with:
@echo off
for /f %%c in ('dir "C:\test" /b ^| find /c /v "UnLiKeLy To ExIsT"') do set TOTFILES=%%c
If %TOTFILES GTR 4 ECHO GREATERTHAN4
It appears to set the variable "TOTFILES", but it gives me the output "GREATERTHAN4" no matter how many files are in the folder "c:\test".
Any ideas?
Here is the test batch file I have been playing around with:
@echo off
for /f %%c in ('dir "C:\test" /b ^| find /c /v "UnLiKeLy To ExIsT"') do set TOTFILES=%%c
If %TOTFILES GTR 4 ECHO GREATERTHAN4
It appears to set the variable "TOTFILES", but it gives me the output "GREATERTHAN4" no matter how many files are in the folder "c:\test".
Any ideas?