Execute Script from command line

Don't hesitate to post if you have an improvement idea
Post Reply
peterjk1970
Posts: 1
Joined: 17 Jun 2021, 23:20

Execute Script from command line

Post by peterjk1970 »

Is there a way to execute a script file from on windows startup?
francois
Posts: 460
Joined: 18 Oct 2010, 10:33
Location: France

Re: Execute Script from command line

Post by francois »

From the french forum :
viewtopic.php?f=25&t=1506&p=5542&hilit=.bat#p5542

Create a ".bat" file :

Code: Select all

set CMD="C:\Program Files\Actiona\actexec.exe"
set PARMS= C:\temp\test.ascr execute,noprogress,notrayicon,noexecutionwindow,exitatend
%CMD% %PARMS%
pooblej
Posts: 1
Joined: 12 Apr 2022, 13:51

Re: Execute Script from command line

Post by pooblej »

Hello

I am trying to get this to work from Ubuntu but I keep getting the following error

I have created sh file with the following

#!/bin/bash
actiona --e-- exitatend ./home/config.ascr

But when is called it say "Unable to load the script because the file is not readable or you don't have enough rights."

Any ideas what I am doing wrong.

The goal is to autostart a script when the machine boots.... Pls can someone help!?
eureka
Posts: 204
Joined: 08 Mar 2016, 22:18

Re: Execute Script from command line

Post by eureka »

There are several methods I use in Ubuntu.

First you can run the Command:
Command: actexec
Argument: MyScript.ascr

Or you can rush a bash script within Python by using Python subprocess

Command: python3
Argument: MyScript.py (which runs shell command)

======================================================

[P.S.] reading again your earlier attempt

actiona --e-- exitatend ./home/config.ascr

this is incorrect syntax.

Run in Ubuntu these commands for help ...

$ actiona --help
and
$ actexec --help

And you can run
$ which actiona
/usr/bin/actiona
and
$ which actexec
/usr/bin/actexec

to see two binaries installed in Ubuntu.

So you first attempt should have been

$ actiona -e -x filepath

or, since you do not need GUI, actexec --help

$ actexec -c filepath

filepath might be $HOME/<path to .ascr script>

So I would stick with using actexec.

==========================================================

[P.S.]

Since you wrote .. "The goal is to autostart a script when the machine boots."
you can create a cronjob which on booting runs Actiona script.
A chain.
Post Reply