Let me give you an example:
file_copy.bat- @echo off
- if exist %systemroot%\stub_file goto end
- copy /y source_file.txt c:\target_directory
- echo > %systemroot%\stub_file
- :end
複製代碼 The script looks for a stub file before it starts actioning, if it's there it will stop and finish. If no stub file is found then it will continue with the next actions. |