Issue console command in a button

Is it possible to issue a console command like ‘load compact usermailfile.nsf -B’ when clicking a button in Formula or LS? assume the person has full administrator rights.

Subject: Issue console command in a button

Try this (form the R5 forum), I have used it in the past . . .

http://www-10.lotus.com/ldd/46dom.nsf/55c38d716d632d9b8525689b005ba1c0/8a195adbca34648785256b1e0030904a?OpenDocument

Subject: I got it. Thanks.

It’s easy in LS. Here is sample code I wrote:

%INCLUDE “lsxbeerr.lss”

Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Dim collection As NotesDocumentCollection

Dim doc As NotesDocument

Set db = session.CurrentDatabase

Set collection = db.UnprocessedDocuments

Set doc = collection.GetFirstDocument()

While Not(doc Is Nothing)

	If doc.type(0) = "Person" Then

		mailServer$ = doc.mailServer(0)

		mailFile$ = doc.mailFile(0) + ".nsf"

	Elseif doc.type(0) = "Database" Then

		mailServer$ = doc.mailServer(0)

		mailFile$ = doc.mailFile(0) 

	Else

		Goto NextDoc

	End If

	consoleCommand$ = "load compact " + mailFile$ + " -B"

	consoleReturn$ = session.SendConsoleCommand( _

	mailServer$, consoleCommand$)

	Messagebox consoleReturn$,, consoleCommand$

NextDoc:

	Set doc = collection.GetNextDocument(doc)

Wend

End Sub