Search This Blog

Friday 1 July 2022

WatchDirectory - Could not create temporary file

 

If you try to edit or create a WatchDirectory task and receive a message like

"Could not create a temporary file"

Here is the reason and how to resolve this issue.

Why this happens

While you create or edit a task the WatchDirectory Control Center needs to store your new settings somewhere. It can not be inside the WatchDirectory settings directory itself because you may cancel editing. So WatchDirectory asks Windows what the directory for "temporary files" is.
All your changes are made to a temporary file inside that directory. When you press OK, the file is moved to the WatchDirectory settings directory.

The problem here is Windows tells WatchDirectory it can create temporary files in some directory (something like C:\Temp), but there is a problem. Typically the directory does not exist or (not so common) WatchDirectory is not allowed to write/create/delete files inside the directory.

How to resolve

Here are the steps you need to follow to fix this:
  1. Stop the WatchDirectory Control Center
  2. Open a Windows command prompt by running cmd.exe
  3. On the command prompt enter the following 2 commands
    SET TMP
    SET TEMP
Those commands will respond with the name of 1 or 2 directories (they typically are the same directory). Now you need to make sure those directories exist and "Everyone" has the privilege to create/change/delete files inside them.


No comments: