The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Remotely Executing OriginLab COM object

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
mphillipsniles Posted - 12/20/2017 : 12:17:16 PM
Hello,

I am trying to remotely execute OriginLab via Powershell (the Powershell script is inside of task scheduler so it automatically will run once a day). There is no user console/interactive session, but a user is executing the script.

I seem to be getting snagged on the User Files. It seems like the user files are set up based on the logged on user of a console session. So when I try to run my powershell script as a user with user files set up, it still can't find any/doesn't know what to do since there is no console session.

I have also tried this with PSEXEC and got similar results.

Is there a way that my Powershell script can tell Origin what user to use, or a path for user files to use? Seems as though it uses whatever the console session is, which in my case is no one. Maybe there is some other way that I can get this working with a remote user session rather than a console session?

This is what my powershell code looks like:

$oOrigin = New-Object -ComObject ("Origin.Application")
$oOrigin.Execute("sec -poc 30")
$oOrigin.Execute("newbook")
$oOrigin.Execute("raingaugegraphing.Section1")
$oOrigin.Exit

All my computer & user settings are correct because I'm executing Powershell & other COM objects remotely just fine.

Thanks
2   L A T E S T    R E P L I E S    (Newest First)
mphillipsniles Posted - 12/21/2017 : 1:14:30 PM
Thanks! I ended up using this plus autologon.
cpyang Posted - 12/20/2017 : 2:20:42 PM
Looks like you are executing Labtalk, so how about running Origin from command line? You can hind it with -h switch.

See

https://www.originlab.com/doc/Origin-Help/Startup-AdjustByComLine

Basically, prepare an ogs file and for example, place it in c:\temp\ called startup.ogs

[Main]
  type -b "hello world";
  exit;


Then assuming your Oirgin is installed to c:\test, then run the following command



c:\test\Origin95_64.exe -h -rs run.section("c:\temp\startup.ogs", main)


CP

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000