úterý 19. července 2011

Run program on server from Lotus Script

There is a special function in Lotus Script that allows you to start a program - function "Shell".


Shell ( program [ , windowStyle ] )

The function ends immediately after executing required program, NOT after the program ends.
However, if run it from Lotus Script agent, it executes on computer, where the agent is executed. So if you need to run something on server (where is the nsf file) you can use this technique:

1) Create agent that runs Shell function
2) Create other Lotus Script agent that runs nr. 1 agent as "agent.RunOnServer"
3) Set security level of agent 2 to level 2 (or 3 if 2 doesn't work)

Remember that the privileges you run the program on server are low - so no access to restricted directories, etc.

It is also good technique for running command line commands - simply write them in a bat file. You can run BAT, COM, PIF, or EXE files.

There is also function called "Shellid" that returns task ID of the started process.

Žádné komentáře:

Okomentovat