Enhance SAM with features tailored to your specific needs! We collaborate with companies, universities, and organizations to privately fund new capabilities or analyses. Your investment drives innovation while benefiting the broader energy community. Email us to learn more.

Running SAM script from command line

  • Andrew
  • Topic Author
More
17 Aug 2026 13:56 #14591 by Andrew
Running SAM script from command line was created by Andrew
I can't get the below to work it. It will open SAM, but not run any part of the script. Has it been implemented or has it been scrapped?

_____________________________________________________________________________
Running Scripts from the Command Line
You can run a script from the command line in a Command or Terminal window. The syntax is:

[path to SAM executable] [any string] [path to .lk script file]

Note the spaces between each parameter.

For example, in Windows, the command might look like this:

c:/sam/2021.12.02/x64/sam.exe not-a-sam-file c:/test.lk

The command starts the SAM desktop application, opens the .lk file in a script editor and runs the script (equivalent to clicking the Run button in the script editor). The middle parameter is required (it can be any string), but does not do anything. You have to manually close SAM when you are finished.

You can also use the following to open a .sam file from the command line:

[path to SAM executable] [path to .sam file]

Please Log in or Create an account to join the conversation.

  • Paul Gilman
More
17 Aug 2026 16:17 #14593 by Paul Gilman
Replied by Paul Gilman on topic Running SAM script from command line
Hello,

Yes this feature still works.

Running the following command from a folder containing the script 'test.lk' starts SAM, opens the script editor window, loads the 'test.lk' script, and then runs the script in the window:

c:/SAM/2026.7.3/x64/sam.exe "" test.lk

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

Moderators: Paul Gilman
Powered by Kunena Forum