I have to create a .BAT file that does this:
- If
C:\myprogram\sync\data.handlerexists, exit; - If
C:\myprogram\html\data.sqldoes not exist, exit; - In
C:\myprogram\sync\delete all files and folders except (test,test3andtest2) - Copy
C:\myprogram\html\data.sqltoC:\myprogram\sync\ - Call other batch file with option
sync.bat myprogram.ini.
If it was in the Bash environment it was easy for me, but I do not know how to test if a file or folder exists and if it is a file or folder.
You can use IF EXIST to check for a file:
If you do not need an "else", you can do something like this:
Here’s a working example of searching for a file or a folder: