Manage Learn to apply best practices and optimize your operations.

How to find files on a hard drive or mapped network with LotusScript

Place this abridged LotusScript code into a button to quickly drill down and locate Lotus Notes files on either a hard drive or a mapped local drive.

Related resources from
Tutorial: 30 LotusScript tips

Top 10 LotusScript tips

LotusScript Reference Center

I wanted to locate a file on either my hard drive or a mapped network drive and import the data into a Lotus Notes database. Because I had already found the code to do the import, I abridged my LotusScript code to provide just the file selection routine, which can be placed in a button or view action.

Placing the LotusScript code in a button gives the Notes user a choice of drives (it defaults to the C: drive, as seen in Figure 1).

Figure 1. Identify the drive you want to select the file from.

Lotus Notes users then receive a list of folders and files matching a pattern, for example .xls. However, this can be changed.

There also is an abort/cancel option at the top of the list that lets you drill down into the next directory to locate the relevant file. An option to move back to the root is also provided as Lotus Notes users drill down into directories. You should select "..", in case a user drills down into the wrong route and cannot find the required file.

Figure 2. Select the file.

Once the file is selected, the full drive, path and filename are returned and displayed on screen (as seen in Figure 3).

Figure 3. The full drive, path and filename are displayed as the selected file.

LotusScript to locate files
(Click on code for enlarged view and script download.)

Do you have comments on this tip? Let us know.

This tip was submitted to the tip library by member Jerry Eaton. Let others know how useful it was using the rating scale below. Do you have a helpful Lotus Notes Domino tip or code snippet to share? Submit it to our monthly tip contest to be entered to win a prize.

Dig Deeper on LotusScript

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...