Search This Blog

Tuesday 16 December 2008

WatchFTP 2.0 Beta

WF 2.0 Beta 1

A new beta for WatchFTP is available, see our forum for download links.

This beta has 2 major improvements:

  • A new "Task History" window that shows you all downloaded files and messages
  • An improved "download method". Version 2 will automatically download files in 2 fases:
    • Fase 1: detect files. WatchFTP scans the FTP server for new and changed files. All detected files are recorded in the task history database.
    • Fase 2: download files. All files recorded in Fase 1 are checked to see if they have changed. If they did not change during the last 30 seconds, the file is downloaded.

Free Upgrade

When released, this new 2.0 version will be a free upgrade for all current (1.x) customers. Your license key will continue to work for version 2.0, just install it "on top" of your current WatchFTP version.

Wednesday 3 December 2008

WD 4.5.6 - Run multiple tasks for the same file

New 4.5.6 release

We released version 4.5.6 of WatchDirectory a few days ago and this version has a new Plugin: Run multiple SubTasks for detected files.

Here is a copy/paste from the helpfile with some reasons why you may interested in this new plugin:

  • Less tasks to run.
    A SubTask consumes less resources (CPU, memory...) than a "real" task.
  • Less disk access.
    All SubTasks share the same file-detection of their main task.
  • Guaranteed order of execution.
    If you have multiple tasks monitoring the same directory, you can not be sure which one will detect a new file first. SubTasks will always run in the configured order.
  • Better Overview, easier maintanance.
    Ten tasks, each having ten SubTasks (10*10=100 SubTasks), are a lot easier to manage than 100 "real" tasks.
  • Overcome Operating System limitations.
    Windows™ has limits to the number of Services it can run. By combining several tasks, you prevent hitting that limit.

We have made it as easy as possible to "convert" your current tasks to SubTasks. You can "import" the settings of an existing task by selecting it from the "create new SubTask based on" drop-down. This will copy the plugin settings from the selected task.

Supported SubTasks

This release does not support all plugins to run as SubTasks, future versions will support more.

Download

Download the new version here:
English version
German version

This is a free upgrade for all WatchDirectory 4.x customers. Install the new version "on top" of your current install so it will "see" your previous tasks/settings.

Wednesday 19 November 2008

WatchDirectory 4.5.6 Beta 2 - Combine Tasks

We have a new beta of WatchDirectory available with an exciting new feature:
Run multiple SubTasks - a way to do multiple "things" for a detected file.
It is only the most requested feature, and now we have implemented it.

Not all plugins are currently supported by the "Run Multiple Plugins" task. We will make more plugins capable to run as a SubTask in future releases. Also note that currently, a SubTask can not (directly) use the output-file of an earlier SubTask. We have great plans for this new plugin for future releases and we are open for suggestions.

After you have installed this beta and create a new task, you can find the plugin on the "Other plugins" tab.

Make sure to read the help for this plugin!

Visit our beta forum for the download.

Gert

Sunday 16 November 2008

WatchFTP 1.0.9

We have released WatchFTP 1.0.9 with the following fixes:

Download files from FTP sites automatically
  • If you configured a task to run as a Windows Service, the userid & password were not always properly set.
  • When a task starts it will first do a check upon the configured "local directory" to see if it is accessible.
  • When configuring/starting a Windows Service task, you should get better feedback in case of errors.
  • When configuring/starting a Windows Service task, the annoying "dos box" is eliminated.

You can download the new version here: http://www.watchftp.com/download.html
En Español - http://www.watchftp.es/download.html
Deutsche Version - http://www.watchftp.de/download.html

To install the new version while keeping all your settings/tasks etcetera, make sure to install it "on top" of your previous version. The installer defaults to your previous selections, so just "ok" through all the setup pages.

Friday 7 November 2008

WatchFTP 1.0.8

Monitor FTP sites for new files and download them

WatchFTP Version 1.0.8 has just been released and has the following new features:

  • New: Proxy support.
  • New: Right-click a stopped task and let it "Run Once & Exit".
  • New: Let WatchFTP remove FTP directories after all files are downloaded.
  • Bugfix: The "Run a Batch File" action failed when the path to the Batch file had spaces in it.

To install the new version while keeping all your settings/tasks etcetera, make sure to install it "on top" of your previous version. The installer defaults to your previous selections, so just "ok" through all the setup pages.

You can download 1.0.8 here:
http://www.watchftp.com/download.html

Gert

Friday 31 October 2008

Automatically split PDF into separate pages

Split PDF into separate pages

In a previous post I showed how to add a header page to a PDF using Pdftk. This example uses the same program to split a PDF into separate pages. See the previous post for Pdftk download info.

The previous post only mentioned WatchDirectory, but you can obviously also use WatchFTP's Batch File Action to do the same thing.

The Batch Script

Use the following batch script to let Pdftk automatically split the newly detected PDF.

If you want to use this script with WatchFTP, to automatically split downloaded PDF's into separate pages, you need to change some variable names in the script.
All variables that start with WD_ must be changed to WF_, for example %WD_REASON% in the script below must be changed to %WF_REASON%.

(The script does not show properly in some blog-readers, please copy it from the original post)

Make sure to properly configure the script in the first few lines (the variables PD and OUTDIR). You probably want to make sure the OUTDIR variable is not set to the directory your WatchDirectory task is monitoring. If it *is* set to that directory, WatchDirectory will call your script again (and again) for the split pages.

Thursday 23 October 2008

Undocumented - WatchFTP stops after 10 fails

Please note: the current WatchFTP release (2.2.6, released February 14, 2010) has a new window where you can change the settings mentioned in this blogpost.




FTP Server connections are unreliable

Connections to any internet based services, including FTP servers, are quite unreliable if a program expects to "look at it" 24 hrs a day.

Your PC may be down, your internet connection may be down, the DNS server that translates "ftp.helloworld.com" to "208.xx.16.38" may be down, the FTP server software itself may have crashed (or is overloaded).......

So you see, a program such as our WatchFTP that intends to monitor an FTP server 24/7 needs to take care of this problem. It must not just "crash" when a connection or download fails, or should it?

Why the program *SHOULD* crash

I've listed a few reasons above why a connection to the FTP server may fail. I am quite sure there are a few hundred others, most notably: you entered the wrong userid/password for the FTP server. In such cases (wrong password), do you want the program to keep running? Trying again and again to login with the wrong password? Giving you a nice green icon, suggesting everything is OK - no need to look in the logs???
Surely Not! You only want to see the green icon if everything is OK.
Green Icon = No Action Required from you
Red Icon = Something is wrong - You must investigate!

When the program should *NOT* crash

When connection failures are temporary, you want WatchFTP to retry. Most connection problems (not, for example, password problems) will solve themselves after a few seconds and work can continue.

How WatchFTP solves this for "new tasks"

When you create a new task, or change an existing task, the WatchFTP user interface (wfcc.exe) writes a "bit" to the configuration file, telling the runtime component (wfrun.exe) this is an "untrusted" task. A task that has never run successfully before.

The very first run of a "new task"

When you start the new task, and wfrun.exe encounters an internet error, it will look at that "bit". If the bit is set (this is a new/untrusted task), wfrun will write the error to the log and exit. 99.9% of the time, the error will be caused by an invalid setting - you have entered a wrong password?.

If the first run is successful, wfrun will reset the "untrusted" bit, so the next time it connects to your FTP server, wfrun will behave as in the next paragraph.

Next Runs - The task already exists

This task has proved itself. A previous run has connected to your FTP server and downloaded some files. If this task encounters an error it should ignore any error and retry.

Well, almost. Maybe the administrator of the FTP server has changed the permissions (password)? Should WatchFTP try to connect again and again?

Undocumented Settings

(note that these settings are currently not available in the User Interface of WatchFTP. Future versions may change this).

What will happen on connection failures (for existing tasks, not for new tasks), is that wfrun will retry several times (with a delay in-between) to connect to the FTP server and download new/changed files.

The number of times to retry is a setting inside the "config file" (contains all settings of this task - see below). If it is not explicitly set (and remember, the user interface doesn't have an option to set it), it defaults to 10 retries. If it fails 10 times, the task will stop.

Between each retry, the task will pause a while (to give the problem time to resolve itself). This pause is also read from the "config file" and, if not present, defaults to 60 seconds.

The above defaults give your internet/FTP server 10 minutes (10 retries * 60 seconds) to resolve its problems.

Changing the Defaults

Like I said earlier, currently these setting can not be changed using the User Interface of WatchFTP. You need to change the file containing the settings directly. Below, I describe how to change both settings for a task called MyTask.

  • Stop the task.
  • Right-click it - a popup menu opens.
  • In the popup menu, select Explore Task Directory
    (actually, the menu-entry below it showing MyTask as the last part of the path) - Windows Explorer opens inside the directory with log-files of MyTask.
  • This is one directory to deep, select the containing ("higher") directory in explorer
  • In this directory, you will find a file called MyTask.config. This is the file that contains all settings for the MyFile task.
  • Open this file with notepad (not with a rich-text editor like MS-Word)

In notepad, find the line that says

[FTP]

Immediately after (on a new line) it enter those 2 new lines:

maxfailures=123
sleepafterfailure=10

so it becomes

[FTP]
maxfailures=123
sleepafterfailure=10
... the rest that was here before ...

(If you read this in a blog-reader like Google-reader, the formatting above may be wrong, please see the original post)

The above settings will retry to connect a lot more (123 times, instead of 10 times) and will wait 10 seconds between each retry (instead of the default 60 seconds). This will allow ~20 minutes downtime for your FTP server (123 times * 10 seconds = ~ 20 minutes)

So, if your FTP server if often not reachable for short periods, you will want to set sleepafterfailure to a low value (retry with short intervals).

If your FTP server is sometimes not reachable for long periods, you will want to set sleepafterfailure to a high value (retry with long intervals).

The maximum value for both settings is ~30000. 30,000 retries, 30,000 seconds. Unless I miscalculate, that will give your FTP server ~28 years to recover ;-)

Tuesday 21 October 2008

WatchFTP 1.0.7 released

Automatically Download Files from an FTP server

New in this WatchFTP release

  • The SMTP settings window can now send a Test email.
  • When sending email fails, the error that occurred will be written to the task directory. Previously only the email was saved as an EML file.
  • When a task has sent an email, it will also look for previously failed emails and retry them.
  • Emails now have a proper X-Mailer header set.
  • The Browse-for-FTP-directory window, started by the FTP settings window, did not use the originally entered FTP directory as initial directory.
  • The helpfiles were changed to make them better compatible with Internet Explorer 6.

Upgrade to 1.0.7

If you want to upgrade to the current release (free):

  • Stop all your WatchFTP tasks
  • Exit the WatchFTP Control Center
  • Download the current release
  • Install it in the same directory, "on top" of your current install.

The above steps will ensure you keep your settings and tasks.

Español

Now Also Supports Spanish Language

The new WatchFTP version automatically detects if it is running on a Spanish language operating system. The user-interface, web site and help files are all translated to Spanish.

Spanish language support and forum are available as well.

Gert

Monday 13 October 2008

WatchDirectory Customer - Volvo Ocean Race

I was watching the news on television a few days ago, and there was an item about the Volvo Ocean Race. Knowing they are a customer, I asked them how they use WatchDirectory.
Here is Andrew's reply.

I work on a yacht race.. the Volvo Ocean Race, and we have 8 yachts racing currently in our event. The yachts transmit movies and images back to our headquarters, via satellite, whilst they are racing.

These files can arrive at any time, and I use WD for monitoring each yachts inbox, and when a new file arrives it moves the files to an approval queue.

Once the material has been approved, it is moved to another directory, and then WD again takes over and moves the files to FTP boxes, sends them to our picture editor, or passes them to our in-house TV team. All through these stages, I also use WD to trigger email alerts.

Because of the 24/7 nature of the event, WD is ideal.

In all I think I now have 58 WD processes running, and as I think of more things I can do with it, I add more software.

The next time you see the Volvo Ocean Race on television, remember you see WatchDirectory at work ;-)

Saturday 11 October 2008

Create a Feed of your Files

Create RSS Feeds with WatchDirectory and WatchFTP

Here is a tip from one of our customers (Thanks Preben!)

Most (all?) blog software allow you to post new blogs by emailing the post to a special email address. Both WatchFTP and WatchDirectory can send emails for detected changes. Other people "worldwide" can subscribe to this blog and see the detected filenames/files. See "Security/Privacy" below if you do not want everybody (including Google) to see your blog.

This will allow you to create a blog with all "new files" detected. People can subscribe to the blog (or add it to their iGoogle home page) so they stay up-to-date with what is happening inside the monitored directories.

There are a few things you can do with WatchDirectory's Email Task that are not currently possible with WatchFTP's Email Action (see the bottom of this post), but a future WatchFTP release will improve on that.

Email posts to Blogger

(Blogger Specific Help is here)

Once you have created your blog (free on Blogger), go to "Settings -> Email" and enter a Mail-to-Blogger Address. This will create a special email address on the blogger domain that will automatically publish all emails sent to it.

Create (or change) a WatchDirectory or WatchFTP task that sends email to the above email address. The subject of your email will be the subject of your post. Your (picture) attachments will also be published (WatchFTP currently does not support attachments). If you want to use the contents of the detected file inside a WatchDirectory email (WatchFTP does not support this yet) as part of the message sent to blogger, enter
@@@%WD_FILE%@@@
in the message-body of the email.

Security/Privacy...

When you setup a blog on blogger, you can make the blog "private" to just the people you invite to this blog. Go to "Settings -> Permissions" and set the Blog Readers to Only people I choose. This allows you to have only a selected audience for your blog.

Other important settings are found on "Settings -> Basic", if you are concerned about strangers viewing this blog, make sure you set them properly.
Add your blog to our listings?
Let search engines find your blog?

WatchFTP limitations

Currently, WatchFTP's Email Action has the following limitations:

  • Can not send HTML email
    WatchFTP's email are "plain text" only.
  • Can not attach the detected files
  • Can not use the content of the detected file as the email body

The above limitations will be removed in a future WatchFTP release.
The current WatchFTP release can only show the filename(s) inside the email messages sent to blogger.

WatchFTP 1.0.7 beta

monitor ftp sites for new files and download them

We just released a new beta version of our WatchFTP program. This new version has mostly minor fixes/features for its Email action. We hope to release version 1.0.7 about a week from now.

New in WatchFTP v1.0.7

  • The SMTP settings window can now send a Test email.
  • When sending email fails, the error that occurred will be written to the task directory. Previously only the email was saved as an EML file.
  • When a task has sent an email, it will also look for previously failed emails and retry them.
  • Emails now have a proper X-Mailer header set. See below for possible use.
  • The Browse-for-FTP-directory window, started by the FTP settings window, did not use the originally entered FTP directory as initial directory.
  • The helpfiles were changed to make them better compatible with Internet Explorer 6.

Using the X-Mailer header line

This new WatchFTP version will write a special header line in all outgoing emails. This header line looks like this:

X-Mailer: WatchFTP-TASKNAME

(where TASKNAME is replaced by the name of the sending task).
Most email clients can filter incoming messages based on these header lines. This new WatchFTP feature, for example, allows you to sort these email messages into special folders or highlight them in a special way. See the documentation of your email client how to set this up.

Download WatchFTP 1.0.7

Version 1.0.7 has been released.

Install it in the same directory as your current install so it will keep your settings and tasks.

Friday 10 October 2008

An Add-On to an Add-on

A few days ago, we released a new version of WdNotify, see this blogpost. One of our customers wanted a program to send messages to wdNotify from inside his batch scripts. That would allow him to see the progress of long-running batch files.

wdTraySender

wdTraySender is a simple command-line program you can start from inside your batch files. It sends a message to wdNotify (if it is running, otherwise no harm is done), and wdNotify will show the message on your desktop. How wdNotify shows the message depends on how you configure wdNotify. Currently wdNotify supports OSD (On Screen Display), Balloon tips and a message window.

wdTraySender has 2 parameters:

  • Task name
  • Message text

The first parameter (Task Name) could be the name of one of your WatchDirectory tasks, however anything will do. The second parameter is the message to send. All further parameters are ignored. Make sure to enclose both parameters in "quotes", especially if they can contain spaces.

Example batch script

@echo off
SET TRAY=C:\Program Files\WatchDirectory\wdTraySender.exe

"%TRAY%" "My Example" "script started"
.... some lengty processing ...
"%TRAY%" "My Example" "script ready"

Download wdTraySender

Important Note: wdTraySender can only send messages to wdNotify version 1.3 or higher. wdNotify 1.3 was released a few days ago. Download the latest wdNotify version.

Download wdTraySender here (~60KB).

Wednesday 8 October 2008

New WatchDirectory release - 4.5.5

We just released WatchDirectory version 4.5.5. This is a free upgrade for all WatchDirectory version 4 customers.
Visit the version history to see what's new.

Upgrade your current version

To upgrade, without losing your settings, please follow these steps:

  • Download the latest WatchDirectory version
  • If you use the free wdNotify program, make sure you download and install the latest wdNotify version as well.
  • Stop all your WatchDirectory tasks, including the System.Mail program (wdPostman - responsible for sending email)
  • Exit the WatchDirectory Control Center
  • Start the installer, make sure you select the same directory to install to (so the new version will see your previous settings and tasks).

Wednesday 10 September 2008

Automatically start WatchDirectory tasks

WatchDirectory has a Scheduler that can be used to enable or disable the monitoring part (looking for new/changed files) of a task. This post will show you a way to start or stop the task completely and (more important) automatically.

Starting a task from the commandline

The wdrun.exe program (the program that actually "runs" the task) has several commandline options that can be used to start or stop a task. For example, to start the task named Hello, you enter the following command in the Windows "Run..." menu or a command box (cmd.exe):

"C:\Program Files\watchDirectory\wdrun.exe" -start Hello

If the "Hello" task was already running, no bad things happen. To stop the task:

"C:\Program Files\watchDirectory\wdrun.exe" -stop Hello

This will request the task to stop. Even though the command returns immediately, it can take a few seconds before the task is actually stopped.

Starting tasks automatically

Lets assume you have 3 tasks (called T1, T2 and T3) that you want to start automatically. For simplicity, I assume these tasks are configured to run as a Windows Service. Create a batch file (for example called C:\Bin\Start123.bat) with the following content:

"C:\Program Files\watchDirectory\wdrun.exe" -start T1
"C:\Program Files\watchDirectory\wdrun.exe" -start T2
"C:\Program Files\watchDirectory\wdrun.exe" -start T3

Now find the Windows "Scheduled Tasks" applet on the Windows Control panel (its exact location depends on your Windows version). Create a new Scheduled task, and configure it to run this batch file. The Windows Scheduler has flexible options to set the days and times when the Scheduled Task should run.

Obviously, you can create another batch file to stop these tasks (replace -start with -stop), I will leave that as an exercise for the reader.

If the task is not running as a Windows Service

The batch file above will not work properly if the WatchDirectory tasks are configured to run as a "normal" program. What happens is that only task T1 will run, because the "-start T1" will actually run the task. This causes the batch file to "hang" on the first command. To start the task in another window so the rest of the batch file will run, we need to use the Windows "START" command.
First, I will show you how NOT to do it (this batch file does NOT work):

REM NOTE THAT THIS BATCH FILE DOES NOT WORK
start "C:\Program Files\watchDirectory\wdrun.exe" -start T1
start "C:\Program Files\watchDirectory\wdrun.exe" -start T2
start "C:\Program Files\watchDirectory\wdrun.exe" -start T3

The reason it doesn't work is because the Windows "Start" command will interpret
"C:\Program Files\watchDirectory\wdrun.exe"
to be the Title of the new window. So, even if we are not interested to give the window a title, we must supply one. Here is a batch file that does work:

start "task 1" "C:\Program Files\watchDirectory\wdrun.exe" -start T1
start "task 2" "C:\Program Files\watchDirectory\wdrun.exe" -start T2
start "task 3" "C:\Program Files\watchDirectory\wdrun.exe" -start T3

The "Start" command has several other possible options, for example you let it open the new window minimized like this:

start "task 1" /MIN "C:\Program Files\watchDirectory\wdrun.exe" -start T1

Hope this helps.
   Gert

Friday 5 September 2008

Automatically add a header page to new PDF documents

The example batch script below will combine 2 PDFs using the pdftk program (Auf Deutsch).
One of the PDF files is a "static" page that will be used as the "header" for the output PDF. The other PDF file is the file detected by WatchDirectory.

Download pdftk

You can download the Windows version of pdftk here:
http://www.accesspdf.com/article.php/20041130153545577

WatchDirectory task

Create a new task and select the run a batch file plugin. Select the sample batch script below (make sure you changed its settings the way you need). Make sure you only select the "FILENEW" option on the Events page.

The example batch script

Below is the example script. Please make sure to change the 3 settings starting on line 5 to the correct location of pdftk, the header.pdf you want to use and the output directory.
(The script does not show properly in some blog-readers, please copy it from the original post)

If you want the script to automatically delete the original PDF, remove the REM on the last line.

A small variation

If you want to add the static page as the last page of the new PDF, change line 15 from (original):

"%PD%" "%HDP%" "%WD_FILE%" cat output "%OUTDIR%\%WD_FILE_N%"

to (new):

"%PD%" "%WD_FILE%" "%HDP%" cat output "%OUTDIR%\%WD_FILE_N%"

Thursday 21 August 2008

WatchDirectory 4.5.5 beta + wdNotify 1.3 beta

Please note: this is a beta release!

This new beta release of WatchDirectory and WdNotify fixes an issue where WatchDirectory can not properly communicate with WdNotify.

The issue that is fixed is most noticable on Windows Vista, but earlier Windows versions with enabled Terminal Services or "Fast User Switching" could also be affected.

Furthermore, the following are "new":

  • you can set the font-size of OSD messages
  • WdNotify didn't recognize "upper-left" for OSD messages

Normally we would release this new version "immediately", but as this new release causes a few incompatibilities, it is released as a beta first.

To use this new beta, you need to download and install *BOTH* the new WatchDirectory *AND* the new WdNotify release.

See this forum post (English) or this German post for the download links.

Incompatibilities

The new WdNotify v1.3 will *not* work with previous WD versions (WatchDirectory versions 4.5.4 or below). WatchDirectory v4.5.5 will *not* work with previous WdNotify versions (WdNotify v1.2 or below).

So, when you upgrade to WD 4.5.5 (or higher) and you use WdNotify, you must also upgrade WdNotify.

Check for Updates

Please note that if you install these beta versions and a "check for update" occurs, WatchDirectory will tell you a new version is available. Please make sure to check the version-numbers carefully to make sure it actually is a new release.

Monday 11 August 2008

WatchFTP v1.0.6

We have just released a (minor) new version of WatchFTP. This is a free upgrade for all customers. Just stop all your tasks and install the new version "on top" of your previous install.
This release contains the following fixes:

  • If an incorrect FTP directory was entered, the task mistakenly used the root directory of your FTP server. (thanks for reporting this, Markus)
  • The option "delete file after download" did not work properly for files containing accented characters. (thanks for reporting this issue, Jari)

You can download the current release here:
http://www.watchftp.com/download.html
or here
http://www.watchftp.de/download.html

Tuesday 5 August 2008

Move your Task Directory

In a previous post I showed you how to move your tasks and settings to another computer. This post will show you how you can move the directory with all your settings to another location on the same computer.

When you first run the WatchDirectory Control Center after installing WatchDirectory, it asks you where you want to store your settings and tasks. The default location for this directory is

C:\Documents and Settings\All Users\Application Data\watchDirectory

If you later decide you want to have another location for this directory, follow these steps:

  • Stop all WatchDirectory tasks
  • Stop the "System.Mail" component (wdPostman program)
  • Inside the WatchDirectory Control Center, press the undocumented key-sequence CTRL+SHIFT+9
    This will open Windows Explorer in the directory where you have installed WatchDirectory, normally
    C:\Program Files\WatchDirectory
  • Switch back to the WatchDirectory Control Center and close it
  • Inside the directory that opened Explorer, you will find a file called watchdirectory.ini, open this file with notepad
  • The file contains just the following 2 lines:
    [watchDirectory]
    configdirectory=C:\Documents and Settings\All Users\Application Data\watchDirectory\
    The second line tells WatchDirectory where it should store its settings and tasks

Change the directory above to the directory where you want to store your tasks and settings, for example

[watchDirectory]
configdirectory=C:\WatchDirectory\

And copy the original directory to this location.

Some important notes

  • Use a "plain text" editor to change watchdirectory.ini
  • The directory must be on a local drive, do not store your settings on a network drive!
  • Make sure the directory-name in watchdirectory.ini ends with a backslash (\)
  • Do not store the directory under a user-specific folder, for example the following folder is not a good idea:
    C:\Documents and Settings\John Doe\Application Data\watchDirectory\

Troubleshooting

Start the WatchDirectory Control Center again. You should see all your tasks. Select the menu "Tools -> Explore Task Directory" to verify WatchDirectory now uses the new directory.

Have a good look at the tasks that show in the WatchDirectory Control Center. Do all columns show appropriate information? For example, do you see the correct directories under "Monitors Directory"?

If "yes", congratulations! You have successfully moved your task directory.

If "no", it means WatchDirectory isn't able to read the settings of your tasks. This can be caused by 2 things:

  1. If you see no tasks at all, you have misconfigured the directory in watchdirectory.ini, please try again
  2. If you do see all tasks, but they have missing descriptions etcetera, it means WatchDirectory doesn't have permission to read the task settings. Follow these steps to correct it
    • Close the WatchDirectory Control Center
    • Open Windows Explorer and navigate to the new task directory (C:\WatchDirectory)
    • In Explorers' left pane, right-click the directory name and select "Properties" from the popup-menu
    • Open the "Security" tab
    • Make sure the "user" called "Everyone" is listed and make sure it has all privileges.
      If "Everyone" is not listed, add it and select the "Full Control" option under privileges.
    • Press Advanced and make sure the option to replace "inheritable permissions on all descendants" is checked
    • "OK" out of all the dialogs, saving the permissions

The above should fix 99% of all permission problems for the new task directory.

Sunday 3 August 2008

Move your WatchDirectory Install to another Computer

This post shows how you can move your WatchDirectory install to another computer, making sure all settings and tasks are the same.

This post is also available in German language / Blog auf Deutsch lesen

On the old computer

All your settings and tasks are stored in the WatchDirectory Task Directory. So basically, you need to copy that to the new computer.

  • Stop all your WatchDirectory tasks
  • Stop the "System.Mail" component (wdPostman program)
  • Select the menu "Tools -> Explore Task Directory"
    This will open Windows Explorer in your task directory, which normally is
    C:\Documents and Settings\All Users\Application Data\watchDirectory
  • ZIP the above directory, including all sub-directories

If you use the "Automatically Run a Batch File" or "Automatically Run a VBS script" tasks, you should also copy the required scripts.

On the new computer

  • Install WatchDirectory and run the Control Center once so it will setup the task directory.
  • Make sure all tasks (if any) are stopped.
  • Select the menu "Tools -> Explore Task Directory"
  • Exit the WatchDirectory Control Center
  • UNZIP the archive of the old computer

How to run...

The above will have made all your tasks available on the new computer. However, the "How to run..." settings are not effective yet. For example, if your task was set to run as a Windows Service on the old computer, the new computer will not have a service for this task yet. Also, if your task was set to run from the Windows "startup menu", it will not yet appear on the Windows menu.

To correct the above, edit each task, change the "How to run..." setting to something else and press OK. Edit the task again and change the "how to run" setting back to the original setting.

Windows Services

If your task ran as a Windows Service on the "old computer" and you configured it to run as another user (not the default "LocalSystem" user) you must redo that setup again on the "new computer".

Your License Info

Your license key is not transferred, you will need to enter it again. Look for an email with the subject "Your permanent registration key for watchDirectory" in your email client. Alternatively, visit this page to have it emailed to you again.

Troubleshooting

Please read the Troubleshooting section in Move Your Task Directory.

See Also

Move your File Viking install to another Computer
Move your WatchFTP install to another Computer (soon)

Wednesday 23 July 2008

Print PDF to any printer - Without Acrobat

The previous post showed how you can print to any printer with some "secret switches" passed to Acrobat Reader®. Here is another way to print PDFs without using Acrobat at all. This is a far more efficient way of printing as it doesn't need to load Acrobat.

For this to work, your printer must support direct printing of PDF/Postscript (nearly all Postscript Level 3 printers support this).

Create a file called AutoPrintPdf.bat using a plain text editor (notepad, do not use editors like MS Word!), and enter the following inside the file:

rem ignore files that do not have a PDF extension
IF "%WD_FILE_E%" NEQ "PDF" GOTO :EOF
rem ignore all events, except FILENEW (a new file is created)
IF "%WD_REASON%" NEQ "FILENEW" GOTO :EOF
rem send it to printerport "raw" on server "server"
LPR -S server -P raw "%WD_FILE%"

Replace server with the name or ip address of the server to which the printer is connected.
Replace raw with the name of the printer. If this name contains spaces, surround the name with "quotes".

Create a new watchDirectory task, select the Run an existing .bat file plugin.
Click the "EXBAT" variable, and browse/select the AutoPrintPdf.bat you have just created.
On the Filter Events page create a filter so this task will only process files with a PDF extension.
On the Events page, only select the FILENEW option.

Or just use Foxit Reader

The current WatchDirectory release has a new task that uses Foxit Reader to print PDF's. Please see this blogpost.

Monday 21 July 2008

Print PDF to any printer

The current implementation of WatchDirectory's Print PDF plugin always prints to the default printer. Here is a small tip if you want to print to another printer.

This is what Adobe has to say on this subject:

The DDE command line parameters for Acrobat and Reader are as follows. These are unsupported but have worked for some developers.

AcroRd32.exe /p filename
- executes the Reader and prints a file
AcroRd32.exe /t path printername drivername portname
- Initiates Acrobat Reader, prints a file while suppressing the Acrobat print dialog box, then terminates Reader.

The four parameters of the /t option evaluate to path,printername, drivername, and portname (all strings).
printername - The name of your printer.
drivername - Your printer driver’s name. Whatever appears in the Driver Used box when you view your printer’s properties.
portname - The printer's port. portname cannot contain any "/" characters; if it does, output is routed to the default port for that printer.

Note: If using Acrobat, substitute Acrobat.exe in place of AcroRd32.exe in the command lines.

The current implementation of WatchDirectory's "Print PDF" plugin passes 2 parameters to Acrobat:
/p - like above: print the pdf
/h - undocumented - do not show Acrobat's window while printing

If you want to print to another printer than the default, you need to use the "Run Any Bat File" plugin (you will find it on "New Task -> Scripting") and use the following batch file to do the printing:

rem you may need to change this, where is acrobat reader?
SET ACRO=C:\Program Files\Acrobat\Reader\AcroRd32.exe
SET TIMEOUT=60
rem if the printername doesn't contain spaces, remove the "quotes"!
SET PRINTER="My Printer"
SET GDPU=%WD_INSTDIR%\GdPUtil.exe



rem check for valid file type
IF "%WD_FILE_E%" NEQ "PDF" (
   %ANNOTATE% Warn "File not printed, only PDF files are supported"
   GOTO :Eof
)

"%GDPU%" -runkill %TIMEOUT% "%ACRO%" /t "%WD_FILE%" %PRINTER%
%ANNOTATE% Info done

Please change the script as needed (printername, location of Acrobat Reader).

Adobe® and Acrobat® are registered trademarks of Adobe.

Tuesday 1 July 2008

WatchFTP Roadmap

This post will show you some future enhancements that are planned for WatchFTP.

version 1.1 (end of summer - probably beginning of August)
* Add support for a history database instead of plain log files

version 2.0 (no estimate yet) - this will be a free upgrade for version 1.x customers
* Tighter integration with our other program WatchDirectory - WatchFTP will be able to "alert" WatchDirectory directly about newly downloaded files. In this case WatchDirectory will not need to monitor a directory for changes.

A lot of other (smaller) features are planned, but the above are the major ones. All suggestions are welcome.

Friday 27 June 2008

How Task History Works....

Playing with some screenshots, SnagIt and Microsoft's Gif Workshop, I have created an Animated GIF that shows how WatchDirectory's Task History Viewer works.

The Task History has all the (error) messages of your task, and can show you which files were detected and processed.

To view it "Full Size", click the picture below.

Sunday 22 June 2008

WatchFTP 1.0

Monitor your FTP Server

After months of Beta's (thank you all for testing) last Tuesday we released WatchFTP 1.0 (also available in German).

WatchFTP monitors your FTP server for new and changed files and automatically downloads them to a Windows folder. After download, it can optionally start a batch file (for example, to import the new file into a database) and send an email.

Give WatchFTP a try and stop wasting time monitoring your FTP server with inadequate tools.

WatchDirectory Customers

WD Customers get a 25% discount, just contact us with proof of your previous purchase.

WD + WF = 100% Automation

Obviously, WatchDirectory and WatchFTP can work together. WatchFTP downloads a file and WatchDirectory processes it further.

A near future version of WatchFTP (free upgrade) will allow you to "directly trigger" WatchDirectory. WatchDirectory will not have to monitor the directory, but will receive a "signal" from WatchFTP after a download is complete.

Hope you will enjoy our new program!

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.

Monday 9 June 2008

WatchFTP Beta 7 - Only one more to go

We just released one of the last beta versions of our new program WatchFTP.

There will be one more beta after this one to make WatchFTP more "robust" in case of intermittent Internet connection problems.

You can download WatchFTP here.

Saturday 31 May 2008

WatchFTP Beta 4 - public beta

It took some time, but finally Beta 4 is available.

New in Beta 4:
  • Can run tasks as a Windows Service (*)
  • Can (optionally) remove the file from your FTP server
  • The Batch & Email actions can use a lot more variables (code stolen from WatchDirectory) - see help

WatchFTP is now "feature complete", there is no extra functionality planned.

TODO:
  • I believe there is one or two helpfiles missing
  • German helpfile
  • German translation of the program

Notes: (*) Vista compatibility testing took a long time. It should work fine now, for services and for "run as a normal program".

Download this version here and install "on top" of your current WatchFTP install:
download

Tuesday 27 May 2008

Undocumented - Auditing with WatchDirectory

Intro

The Audit Plugin writes auditing reports for all changes detected inside the monitored directory. The format of these reports is considered not very "user friendly" by most people. In this blogpost I will show you an undocumented feature that allows you to change the appearance of these reports.

The default format

If you "do nothing", the audit information that is written looks like this:

File/Directory C:\WUTemp\Disasm.log 
   from 7/24/2005 10:41:31 AM to 7/24/2005 10:41:31 AM
[2036] 7/24/2005 10:41:31 AM, Open File by GDPLAP\\Jeremy. Program C:\WINDOWS\explorer.exe. 
   Permissions requested Delete, Read Attributes
   [2036] 7/24/2005 10:41:31 AM, Used a granted permission. Permission used Delete
   [2036] 7/24/2005 10:41:31 AM, Delete 
[2036] 7/24/2005 10:41:31 AM, Close

This tells you that user GDPLAP\\Jeremy used Windows Explorer to delete the file C:\WUTemp\Disasm.log on July 24, 2005 10:41:31 AM.

Change the report format

To change the report format, you need to create a text file named "template.txt" in the "task directory" of this auditing task. Below I assume you have named your task AuditDirectory.

  • Stop the task (AuditDirectory)
  • In the WD Control Center, select the menu "Tools -> Explore Task Directory.
    This opens Windows Explorer in the directory with all your task settings, normally
    C:\Documents and Settings\All Users\Application Data\watchDirectory
  • Open the sub-directory with the same name as your task (AuditDirectory)

Inside this directory, you need to create a file called template.txt. Write the text for the desired layout in this text file. You can use the following variables in this file:

%WD_USER%The user who "did it"
%WD_COMPUTER%The computer from which the user "did it"
%WD_PROGRAM%The program the user used
%DEFAULT%The original message-format (not very useful)

You can also use all variables listed here.

Example

User who did it %WD_USER% (on computer %WD_COMPUTER%)
Using this program %WD_PROGRAM%
The file %WD_FILE%
The original name %WD_OFILE% (if the file was renamed)
What happened is %WD_REASON%
The default auditing output:
%DEFAULT%

Friday 23 May 2008

WatchDirectory 4.5.3

We just released a new version of WatchDirectory - v4.5.3.
New in this release:
  • New: Compatible with Windows 2008 Server.
  • Update: The previous release of the FTP plugin introduced NOOP commands to keep the connection alive. Some FTP servers have trouble with this option, so this release makes them optional.
  • Update: The "Fast Monitoring Method" would sometimes report the so-called "short filename" (file~01.txt), depending how the file was created. This new version will try to convert short filenames to their "long" equivalent.
  • Update: Added support for the new eventlog format of Windows Vista and 2008 to the Audit plugin.

Special thanks to "Jobey" who alerted us that WD would not start on Windows Server 2008. We would have found out ourself (just yesterday we added a Windows 2008 computer to our test-farm), but we did not intend to test WatchDirectory on it until the next release (originally planned at least a month from now).

Download the new release from this page. Install it in the same directory as your current install so it will "see" your current tasks and settings.
This release, like all 4.x releases, is a free update for all WatchDirectory customers with a 4.x license key.

Wednesday 21 May 2008

Barracuda Spam Firewall

It is just awful! What a piece of junk hard-, soft-, cr*p-ware!

Are you, or is your company using the Barracuda Spam Firewall? Don't be surprised if you do not receive a response on questions....

It seems that Barracuda just deletes all email from anyone not explicitly "white listed". Also, if a message contains an URL (for example www.watchdirectory.net or some such extremely dangerous website address), it is also rejected by Barracuda...

Barracuda: Eating your Email For Pleasure

If your company uses Barracuda, Please use a hotmail or gmail address when you contact us.

Sending email with WatchDirectory - 10061 - Connection Refused by Remote Host

Most people have a firewall, spamfilter and/or virusscanner installed to protect them from the evil outside world. What some people don't realize is that these scanners also try to protect the "evil world" from you...

When you want to use WatchDirectory to send email, you need to configure its email-settings. When you press the test button an attempt is made to send an email.

This often fails..... Your firewall (spamfilter, virusscanner) detects that a program is trying to send email, ooh horror!! If it is a nice firewall, it will give you a popup window asking you to allow or deny the program (WatchDirectory) to send an email. Corporate firewalls (McAfee comes to mind) often don't ask you and just block the attempt to send email.

When WatchDirectory can not send the test-email, it asks you if you want to see the message-log. This log will typically contain something like this:

          Socket=804, RemoteIP=a0a36147, RemotePort=25
          ERROR(1038112204): SockCode=-10061 SeeCode=-36 PrevState=104
          ThisState=105 NextState=105
          Error attempting to connect. Connection refused by remote
          host.vSocket: 0 closed
The SockCode above - 10061 is the typical errorcode WatchDirectory receives when your firewall blocks the email.

How to resolve If your firewall did not prompt you to allow email access by WatchDirectory, you will need to change the firewall (spamfilter, virusscanner) settings yourself.

Some firewalls lets you configure this "per program", for others you need to completely disable "bulk email protection". Make sure to allow the following 2 programs: wdcc.exe - this is the WatchDirectory Control Center, it needs to be allowed so you can test your email settings. wdPostman.exe - this is the "System.Mail" program that sends email on behalve of all your tasks.

Monday 5 May 2008

Quotes in batch files - Correcting a small mistake

When you enter a filename (includes program names) inside a bat file, or enter a command on a command-prompt (cmd.exe) always make sure to enter it between "quotes". Microsoft made a "small mistake" when they developed Windows-95.... They allowed spaces in file-names and directory-names. This has caused a lot of trouble over the years... You know the DEL (delete a file) command?
Simple:
DEL C:\Rubbish\GetRidOfIt.txt
No problem above, the DEL command will know what to do. However, lets assume the directory "C:\Rubbish" is actually called:
C:\My Garbage
(note the space? yes, you do!) - so you enter
DEL C:\My Garbage\GetRidOfIt.txt
One of the improvements in Win95 and above is that you can enter multiple file specs on the command-line for DEL (and a lot of other commands too). The above command will be interpreted by Windows as
DEL C:\My
DEL Garbage\GetRidOfIt.txt

Probably not what you want... The second command (DEL Garbage\....) could be in any directory where your script is running, how would you know? It would use the "current directory" to find out which file you meant.

Lets suppose you wanted to remove some files in the program-files directory:

DEL C:\Program Files\My Program\*.*
Windows would try to
DEL C:\Program
DEL Files\My
DEL Program\*.*

So....

Inside batch scripts and on command-lines, ALWAYS enclose everything in "quotes", this tells Windows: No, I am not entering multiple arguments here, please treat this as a single file-spec

DEL "C:\Program Files\My Program\*.*"
DEL "C:\My Garbage\GetRidOfIt.txt"

Why do I tell you this?

Because our WatchDirectory program and future WatchFTP program starts your batch files with a lot of %VARIABLES% (see here), and they are not surrounded with quotes!

DEL "%WD_FILE%"

Just "quote" everything in your batch script

Magical....

I promised earlier in my post on PhotoShop to write something about ImageMagick. ImageMagick is a great Open Source tool for people who want to manipulate their images. It is free to use, even for commercial purposes, I quote:
It allows you to freely download and use ImageMagick software, in whole or in part, for personal, company internal, or commercial purposes;

There are a few restrictions (read the license) that basically boil down to: "don't pretend you created ImageMagick"

Using ImageMagick to Automate your work

WatchDirectory can be used together with ImageMagick's command-line tools to AutoMagically transform your pictures. WatchDirectory (and our upcoming WatchFTP) has the option to start a batch file for each new (image) file detected.

The most powerful ImageMagick command-line tool is the convert command, but I MUST WARN YOU before you use it...

A Warning about Convert

When you enter the CONVERT command on a command prompt, strange things may happen... Windows itself has a command called CONVERT, and it is a rather painful command if you, by accident, get its command-line options right... What the Windows CONVERT command does is a complete transformation of a disk to NTFS format (could take hours). In the below examples I make sure to enter command-lines like

"C:\Program Files\ImageMagick-6.3.7-Q16\convert.exe" bla-di-bla
and NOT
convert bla-di-bla
as that may, by accident, start the disk-convert program, instead of the picture-convert program... Anyway, it is always a good idea to use "full paths" in batch files (and always enclose them in "quotes", more on that in a future post)

Continuing...

I will give you a few very short, sweet examples of using ImageMagick's convert command in a batch file that is started by WatchDirectory's Automatically Run A Batch File plugin. This blog-post will do just one, and tries to explain all caveats, workarounds and tricks. Future posts will concentrate more on features (how to do "x" with ImageMagick/WatchDirectory).

Convert from JPG to PNG

Your batch file should look like this:

"C:\Program Files\ImageMagick-6.3.7-Q16\convert.exe" "%WD_FILE%" "%WD_FILE_D%%WD_FILE_B%.png"

What does the above translate to? All variables (like %WD_FILE%) are explained on this page. Ok, just for this first example, I'll tell you:
%WD_FILE% - This is the complete path + filename of the file that is detected by WatchDirectory, for example C:\Monitored\Subdir\Hello.jpg.
%WD_FILE_D% - The directory where the new file is found, C:\Monitored\Subdir\
%WD_FILE_B% - The filename without its extension, Hello in this case.

So, just try to see what happens when WatchDirectory starts this script for the file C:\Monitored\Subdir\Hello.jpg... The command that Windows will perform is actually (after replacement of all %VARIABLES%):

"C:\Program Files\ImageMagick-6.3.7-Q16\convert.exe" "C:\Monitored\Subdir\Hello.jpg" "C:\Monitored\Subdir\Hello.png"

Now, isn't that quite simular to the first example of ImageMagick's Convert program??? You can now probably use a lot of ImageMagick's examples together with WatchDirectory, but please don't leave yet, read on... I have more to say...

A small problem...

Did you notice that the above batch file will create the PNG file in the same directory as where the original JPG is found? WatchDirectory will detect the new PNG file and start your batch file for that file again. So, your batch file is started for the file C:\Monitored\Subdir\Hello.png and Windows will run your script as

"C:\Program Files\ImageMagick-6.3.7-Q16\convert.exe" "C:\Monitored\Subdir\Hello.png" "C:\Monitored\Subdir\Hello.png"

mmmm, it could even get worse as ImageMagick will gladly convert a PNG to PNG, and WatchDirectory will now see a changed file and start your script again (and again, and again....)

One obvious solution is to create the PNG outside the monitored directory, in that case you would use this script:

"C:\Program Files\ImageMagick-6.3.7-Q16\convert.exe" "%WD_FILE%" "C:\OtherDirectory\%WD_FILE_B%.png"

That would work.... but if you really need to have the PNG in the monitored directory, you need to make sure the script ignores files that are "already PNG":

IF /I "%WD_FILE_E%" EQU "PNG" GOTO :EOF
"C:\Program Files\ImageMagick-6.3.7-Q16\convert.exe" "%WD_FILE%" "%WD_FILE_D%%WD_FILE_B%.png"

The "IF /I "%WD_FILE_E%" EQU "PNG" GOTO :EOF" will exit the script for files with a PNG extension.
%WD_FILE_E% - the file extension in UPPERCASE

Another option would be to configure WatchDirectory to ignore PNG files for this task.

Remove the original file after converting to PNG

Yes, I saw that coming, please try this batch file:

IF /I "%WD_FILE_E%" EQU "PNG" GOTO :EOF
"C:\Program Files\ImageMagick-6.3.7-Q16\convert.exe" "%WD_FILE%" "%WD_FILE_D%%WD_FILE_B%.png"
DEL "%WD_FILE%"

Coming next, another ImageMagick script?

ImageMagick is really a great tool to work with/transform your pictures. Doing this together with WatchDirectory allows you to Automate it! There will be future ImageMagick posts here!

Friday 2 May 2008

Drop it.... Photoshop

Automatically photoshop your pictures, automate your droplets!

We quite often get questions about our thumbnail plugin from professional photographers. They want to do "bla bla bla" with their pictures... I don't even own a camera anymore - I am a Dinosaur in these days I guess. Most people are happy to have a task to reduce the size of a picture, some need more....

101 % flexibility

Did you know that WatchDirectory can start Batch files? - do you know what batch files are???

Did you know Photoshop can create "droplets"? Do you know what droplets are???
(actually, I didn't - someone told me)

Did you know the above makes sense, and actually can work together?

Ok, so you already know Photoshop. You can manipulate a picture "the way you want it", but it is a tedious, boring job to do with Photoshop for every single picture... You just want to do "the same thing" for every new picture....

Lets Automate (yeah!) First, you need to create a droplet in Photoshop, here is a google search for you to get the finer details: clickerdiclick The first link at the time of writing was Automate Your Favorite Photoshop Routines. Basically, a droplet is a kind of macro (action) you create in photoshop. You save this droplet on your disk somewhere (for example C:\Bin\MyDroplets\Smaller.exe) and when you drop a picture on it, it will automagically run all your tedious tasks.

Did you create your droplet? ok, now we will automate further by letting WatchDirectory automatically "drop" new pictures on your perfect droplet.

Create a new file called, for example, C:\droplets\mydroplet.bat, with notepad and make sure it has a .bat file extension! (do NOT use editors like Word for this, they add rubbish to the file that is NOT compatible with these scripts). The bat file should have the following line:

"C:\Bin\MyDroplets\Smaller.exe" "%WD_FILE%"

The above will start your droplet (smaller.exe in this example) on the new file detected by WatchDirectory! Use the Start a Batch File task to start this script.

If you want to remove the original file after this droplet did its thing, you should use this batch file:

"C:\Bin\MyDroplets\Smaller.exe" "%WD_FILE%"
DEL "%WD_FILE%"

Coming next - use ImageMagick with WatchDirectory

WatchFTP Beta

We started with a new Windows program called WatchFTP.

This program monitors an FTP site and automatically downloads new and changed files. After downloading, you can choose from several additional "actions" to perform on these files. Currently there are 2 actions you can choose from:

  1. Send an Email - to notify you of these new files
  2. Start a batch script - to do some "post processing" on the files

Obviously our WatchDirectory program, that monitors Windows folders for new/changed files, is a perfect companion to WatchFTP - or perhaps it is the other way around ;-)

This WatchFTP program is currently in Beta, we expect to release it one or two months from now - somewhere in June. If you can't wait and want to help during the beta period, please drop an email to support at WatchFTP dot com.

Gert

Welcome

Hi,

So finally I join "the future" and start blogging. Our newsletter has been on hold for a while - it is getting quite hard to email people without ending up on a spam-list, sigh...

The idea is this blog will publish small tips and tricks about our program WatchDirectory and our upcoming WatchFTP. You can expect one or two posts each month.

About me: I am Gert Rijs, owner and main developer at GdP Software. I used to work as a Java developer for a Dutch consulting firm ( http://www.Itude.com ) but started my own company a few years ago when I lived in Denmark for a year.

Our products are aimed at people wanting to automate their file-based tasks - basically, people who are as lazy (and forgetful) as I am ;-).

Hope you enjoy this blog,

Gert