Search This Blog

Saturday 21 June 2008

Debugging your batch files

When you use WatchDirectory's Batch File plugin or WatchFTP's Batch File Action this tip is for you!

Bat Files are great if they work, but can be a pain to "get right", especially when they run automated by our programs. The WatchFTP help-file has a section called "Troubleshooting" with a tip to debug batch files. Basically, what you need to do, is to "wrap" the batch file with another batch file that captures all your batch file's output.
The sample debugger.bat listed can be used "as is" for WatchFTP. If you want to use the same technique with WatchDirectory, you need to make a few changes (basically, change all occurences of the string WF_ to WD_).

View the Debugging Batch Files trick here.

No comments: