Florin M. Florin M. - 1 year ago 241
Bash Question

Lotus Notes - lotusscript: shell function: illegal function call

I have a problem: I want to run a file from lotusscript code:

Dim result As Integer
result = Shell("D:\testF.dsx", 1)

And I get the following error: Illegal function call.

If I want to execute it from formula it works:

@Command([Execute]; "D:\\testF.dsx")

Thanks a lot!

Answer Source

It is not possible to "Execute" a Textfile. usually there is no "run" function defined for dsx- files.

You could do it like:

Dim result as Integer
result = Shell("notepad.exe D:\testF.dsx", 1)

Or find out, which program is linked to dsx (via registry) and execute the corresponding exe with filename as Parameter. If the filename contains spaces, then it has to be enclosed:

Dim result as Integer
result = Shell({notepad.exe "D:\testF.dsx"}, 1)

And reading your last question this approach for sure is NOT the right for your request. You have to use "open" in order to process files... Like Per Hendrik told you in his response.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download