Welcome to the Mythicsoft Q&A site for:

- Agent Ransack
- FileLocator Lite
- FileLocator Pro

Please feel free to ask any questions on these products or even answer other community member questions.

Useful Links:

- Contact Us
- Help Manuals
- Mythicsoft Home
+1 vote

I have built an index that I regularly search and would like to update it on a daily basis, can I do that with FileLocator Pro?

by (31.3k points)

1 Answer

+1 vote

FileLocator Pro version 2022 added scheduling functionality:

However, the scheduler will only work while the user is logged on, if you wish to schedule updates without the user logged on you can use Windows Task Scheduler to run the index updates automatically. The key tool for maintaining and updating indexes is the command line app flpidx.exe.

The simplest option is to use the Windows Task Scheduler to run the Index Scheduler on start-up. The Index Scheduler can be started with the command:

flpidx -scheduler

Important: The task must be run under the same user account the schedulers were created with, otherwise the scheduler won't be able to read the index schedule configuration (stored in the user's AppData folder).

More information

For older versions of the program, which don't have the Index Scheduler, or if you wish to update the indexes individually you can still use the Windows Task Scheduler.

For example to update the index 'Emails' you could run:

flpidx.exe -path "C:\Indexes\Emails" -update

Note: The example is using the 'path' of the index instead of the 'name' to avoid the need for access to the user's 'AppData' profile.

You can then use the Task Scheduler command line app Schtasks.exe to schedule the update for 1pm on a daily basis:

schtasks.exe /Create /TN "FLPro Email Update" /TR "'C:\Program Files\Mythicsoft\FileLocator Pro\flpidx.exe' -path 'C:\Indexes\Emails' -update" /SC DAILY /ST 13:00 /RU user /IT 

Breaking down the parameters:

/Create     - Command to create a new task
/TN         - The task name
/TR         - The command to run, note the use of single quotes inside the double quotes
/SC         - The schedule, e.g. HOURLY, DAILY, WEEKLY etc.
/ST         - Start time
/RU         - User to run the task as (see User Accounts note below)
/IT         - Run only when user is logged in, alternatively you could use the /RP flag to specify the user's password

You can also use the Windows 'Task Scheduler' Desktop app to create/view/modify scheduled tasks.

User Accounts

The above example includes the /IT switch to schedule the task to only run when the user is logged in, which will also run the task Interactively with the user's session. Here's what it looks like in Task Scheduler:

interactive user

If, however, you want to run the task when the user is not logged in it gets a little more complicated.

Indexes are created or shared for specific user accounts so when updating an index it is important to run the update task as a user account which has been setup for the index. For example, if you try running the task as the Local System account it won't have an index configuration table, unless you specify -path, nor access to other account specific privileges such as network drives.

Run whether user is logged on or not

So, for the task to run properly non-interactively the task needs to be setup with the user's password:

Non-interactive task

Windows Credentials

Finally, if the index is either stored on a network drive or indexes network files all network credentials need to be stored with the user account. If when you try and access the network resource from, for example, Explorer and you are prompted to enter network credentials a scheduled task, which is running non-interactively and therefore can't ask for credentials, will simply fail with Access Denied.

You can use Credentials Manager to check whether or not the user's credentials for a network resource have been stored:

Windows Credentials

Network path mapping

When a task is run outside of the logon session the network mappings may not exist. You therefore either need to re-map the network drive as part of the task, e.g.

net use Z: \\server\folder

Or change your index settings to use the UNC path instead of a mapped network drive.

Distracting Console Window

If the task is 'Run only when user is logged in' then when the task starts it will pop-up a console window that can be distracting (and potentially steal input focus). To stop this from happening you can either use the Index Manager to launch the command or use Windows Scripting.

Option 1: Use Index Manager (v2022)

Use the Index Manager to launch flpidx in a hidden window with the 'exec' switch, e.g.

IndexManager.exe exec -path "C:\Indexes\Emails" -update

Option 2: Use Windows Scripting

Step 1. Create a script

Save the following script to a file, e.g. "E:\Index.js"

var objShell = new ActiveXObject("WScript.Shell");
objShell.run("\"C:\\program files\\mythicsoft\\filelocator pro\\flpidx.exe\" -update -path \"C:\\Indexes\\Emails\"", 0, false);

Step 2. Change the Task Scheduler command to

Program:    wscript
Arguments: "E:\Index.js" /e:JScript

It will look something like this:
Index Update Script

Now when the index updates it should happen invisibly.

by (31.3k points)