#1 2020-04-16 09:25

Grendizerus
Member
Registered: 2017-01-18
Posts: 16

View error log, batch script failing

Hello !

I would like to know if it's possible to view the cause of the errors.
In Shutter > actions > run program, I am trying to launch a bat file.
This works perfectly well on 2 of my computers. But on the third one, it does not work and the shutter Window , in status column, says "error".
The bat file is in the exact same Onedrive location on the 3 computers : C:\Users\Username\OneDrive\Documents\Subfolders\MyBatch.bat
I don't understand what's wrong with the 3d one.

Thanks!
G

Offline

#2 2020-04-16 22:41

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,427

Re: View error log, batch script failing

There is no such log which could explain why the execution of your script is failing. Any non-zero exit code is treated simply as "Failed".

However, you can do some testing which might narrow down potential causes. First thing to try is check that a simple test batch file is executed correctly.

1) Create a file "test.bat" with the following content "ping 8.8.8.8".
2) Add a "Run Program" action in Shutter and point to that batch file.
3) Click the "Now" button in Shutter to execute the action immediately.
4) You should see a Command Prompt window appearing, a ping command executing, and the window closing.

Offline

#3 2020-04-17 10:46

Grendizerus
Member
Registered: 2017-01-18
Posts: 16

Re: View error log, batch script failing

Thanks Den

It works with this simple bat file. But not with mine. I think there is a problem with the bat file itself as it is used to laucnh a Powershell script.
The bat file is like this :
powershell "& ""C:\Users\username\OneDrive\Documents\subfolders\myscript.ps1"""

What I find strange is:
- On this PC if I click on the bat file, it works.
- On 2 other PC's, if I use Shutter to launch the bat file which launches the Powershell script, it works.

Offline

#4 2020-04-17 17:09

Grendizerus
Member
Registered: 2017-01-18
Posts: 16

Re: View error log, batch script failing

Ok I found it. On the problematic PC in Powershell, I had to set "Set-ExecutionPolicy RemoteSigned" in BOTH PowerShell and PowerShell (x86)

Offline

Board footer

Powered by FluxBB