I need to find in a specific folder if there exist a file with zero bytes having the extension *.ff0. The following script is not working since I always get the message "file is non-empty". What is wrong?
@echo off
set out="C:\test_files\*.ff0"
if "%out%" == "" (
echo File does not exist.
) else if "%out%" == "0" (
echo File is empty.
) else (
echo File is non-empty.
)
The second question is that my batch file will be located later on somewhere in an intranet folder, meaning that other people might possibly also have access.
Therefore, what should be the full code so as to do the following :
1-Identify if there is an open instance of the file.
2-If there is, warn the user that someone is already using it and, as soon as it closes, other users may open it