Manage Learn to apply best practices and optimize your operations.

Get server environment variables from a script running on a workstation

This tip is for getting the full directory path on which Domino is installed.

This tip is for getting the full directory path on which Domino is installed (on the server), in a querysave done from a Notes Client. The database itself resides on the server.

To do this, create an agent to get the directory using session.getenvironmentvariable("Directory",True) and write the value to a profile document in this agent. Then in querysave, execute an agent.runonserver and grab the value from the profile document.


The code for the getdirectory agent is:

Dim s As New notessession
Dim directory As String
directory = s.getenvironmentstring("Directory", True)

Dim db As notesdatabase
Set db=s.currentdatabase

Dim doc As notesdocument
Set doc=db.getprofiledocument("Directory")
doc.directory=directory
Call doc.save(True,False)

The relevant code in the querysave:

Set currdb = s.currentdatabase

Dim agent As notesagent
Set agent=currdb.getagent("getdirectory")
stat = agent.runonserver

For i=1 To 10000

Next

Dim doc As notesdocument
Set doc=currdb.getprofiledocument("Directory")
Messagebox doc.directory(0) 

Dig Deeper on Domino Resources

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close