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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Remotely Executing OriginLab COM object
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

mphillipsniles

2 Posts

Posted - 12/20/2017 :  12:17:16 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

cpyang

USA
1406 Posts

Posted - 12/20/2017 :  2:20:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

mphillipsniles

2 Posts

Posted - 12/21/2017 :  1:14:30 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks! I ended up using this plus autologon.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000