This article shows the steps to create a recurring task in Task Scheduler, that will delete Nortek VM recordings older than a specified number of days.
Removing recordings in this way may be useful in situations where a Nortek VM system is always on, and therefor always adding new recordings on the disk. Without precautions, this will lead to the disk filling up completely, which will cause problems.
To automatically delete files older than a specified number of days, use the Windows 11 built-in Task Scheduler. The steps in this article will show you how to create a task that executes the required command at specified intervals.
To open the Task Scheduler console, either use the Windows search option to find it, or use the run command, Windows-key -R taskschd.msc
(Note that this description starts with creating a new task. Once created, it is possible to make changes later, by double-clicking the task, or right-clicking it and selecting "Properties" from the right-click menu.)
To keep tasks organized and separate from the system tasks, first create a new folder in the Task Scheduler console:
- First select, then right-click the “Task Scheduler Library” folder
- Select the "New Folder" option from the right-click menu
- Type a suitable name for the folder (e.g., Nortek VM Tasks) and click OK.
Then create the task itself:
- Select, then right-click the newly created folder and select "Create Task" from the right-click menu.
This will open the "Create Task" dialog window; see figure 1. Figure 1: The "Create Task" dialog window - On the "General" tab:
- In the "Name" box, enter a suitable name for the task (e.g., Remove recordings older than 30 days)
- In the "Security Options" section, select "Run whether the user is logged on or not". (This will ensure that the command window for the task does not appear when the task runs.)
Make sure the "Do not store password" option is cleared, not enabled.
On the "Triggers" tab:
- Click the "New ..." button; this will open the "New Trigger" dialog window, see figure 2.
- Make sure the "Begin the task" drop-down shows "On a schedule". (If not, select this option from the drop-down list.)
- Under "Settings", select and specify when and how often you want to run the task, e.g. weekly or monthly. Select appropriate details for the schedule to the right of the main selection.
(And make sure "Enabled" is selected). - Click the "OK" button to close the "New Trigger" dialog.
Figure 2: The "New Trigger" dialog window
- Back in the "Create Task" dialog window, select the "Actions" tab, and click the "New ..." button there. This will open the "New Action" dialog window; see figure 3.
In the "New Action" dialog window:- Make sure "Start a program" is selected in the Action drop-down menu (if not, select it).
In the "Program/script" box, type the command:
ForFiles
In the "Add arguments (optional)" box, type the following arguments for this command:
/p "C:\path\to\folder" /s /m *.SigVM /d -30 /c "cmd /c del /q @file"
In these arguments, replace "C:\path\to\folder" with the path to the folder where you want to clean out older recordings. For Nortek VM version 3.0, the default location for recordings is
"C:\Users\SurveyVM\Documents\Nortek\VM Acquisition"
If you have changed the location where recordings are stored (or are not sure), you can check the recording location in the Nortek VM software itself, under
Configuration > Application settings > Recorder file location
If needed, you can copy-paste the recording file location from the Nortek VM software to the Task Scheduler dialog window.
The option /d -30 instructs the ForFiles command to look for files older than 30 days. You can change this to another value if needed.
Note that the quotes in the command are needed.
For further details on the ForFiles command, and details of the del command options, open a Windows command window and type
ForFiles /?
or
del /?
- Click the "OK" button to close the "New Action" dialog window.
Figure 3: The "New Action" dialog window Back in the "Create Task" dialog window, select the "Settings" tab; see figure 4.
On this tab, make sure the following options are checked:- Allow task to be run on demand
- Run task as soon as possible after a scheduled start is missed
- If the task fails, restart every ...
and select a suitable interval to retry the task
Other options are less relevant (but don't allow it delete itself).
Figure 4: The "Settings" tab of the "Create Task" dialog window - Click the "OK" button on the "Create Task" dialog window.
- You will be prompted for your administrative username and password.
It is not easy to specify both .SigVM recordings and .VMDiag diagnostics files in a single ForFiles task. If you do want to delete both, the easiest option is to create two separate scheduled tasks for this. But please be aware that the number of VMDiag diagnostics files will be far lower than the number of regular SigVM recordings. The need to automatically remove the diagnostics files is marginal.
(It is possible to create a batch-script that specifies both types of file, in a loop feeding the search mask to ForFiles, and create a Scheduled Task that calls this batch-script. You may have to search the internet for details and guidance on creating a batch-script along these lines.)
Updated