Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

forfiles Statement - Breaking Out Using the break Command

The break command is a powerful command that can be issued from inside of a forfiles loop. It causes UDM to stop iterating through the forfiles loop and resume execution at the command immediately following the end statement marking the end of the loop.

One use for the forfiles statement is to try and copy a series of files, deleting the source file if the copy operation was successful.

Example

The following is a sample that accomplishes this task, exiting from the loop if a file cannot be copied or if, after copying a file, it cannot be deleted:

 

 

  • No labels