Problem scripting batches or executables

Generic issues not specifically related to a QLC+ area.
Post here only if you can't really find the reason of an issue
Post Reply
tli
Posts: 9
Joined: Tue Sep 24, 2019 4:42 am
Real Name: Rusty Shackleford

Cannot get latest QLC+ to launch a .bat via the systemcommand script option on Windows 10 1903. Previous versions of Windows 10 handle this use case just fine.

CMD window never appears on version 1903.

EDIT: Issue is not unique to Windows 10 1903. See below.
Last edited by tli on Sat Sep 28, 2019 3:48 pm, edited 1 time in total.
User avatar
GGGss
Posts: 2741
Joined: Mon Sep 12, 2016 7:15 pm
Location: Belgium
Real Name: Fredje Gallon

Run as Administrator you start QLC+ with?
All electric machines work on smoke... when the smoke escapes... they don't work anymore
tli
Posts: 9
Joined: Tue Sep 24, 2019 4:42 am
Real Name: Rusty Shackleford

I've tried that and it did not help. I've also tried running in Windows 8 compatibility mode and ensured that the .bat is stored in an area where QLC+ has write permission. None of this has helped. Can anyone on 1903 reproduce the issue with launching batch files?
User avatar
GGGss
Posts: 2741
Joined: Mon Sep 12, 2016 7:15 pm
Location: Belgium
Real Name: Fredje Gallon

What exact commands do you use in your script?
can you manually run your .bat file?

(I tried it with a .bat file pinging for ever till you close the window. Manually does work but if I reference in QLC+ to that .bat file the script check feature gives out an error... so a .bat is not seen as executable ??)
All electric machines work on smoke... when the smoke escapes... they don't work anymore
tli
Posts: 9
Joined: Tue Sep 24, 2019 4:42 am
Real Name: Rusty Shackleford

systemcommand:C:\Users\Ian\Documents\test.bat arg:

I've successfully used this on other builds of Windows 10 in the past. The test.bat referenced above is an incredibly simple file:

ECHO ayy
pause
exit

I can run the batch file by itself, but I cannot call it from QLC+ on Windows 10 1903.

What build of Windows 10 are you using?
yokosuna
Posts: 204
Joined: Tue Mar 22, 2016 9:07 am
Real Name:

nop - tested .bat and .cmd, both were executed fine...
tli
Posts: 9
Joined: Tue Sep 24, 2019 4:42 am
Real Name: Rusty Shackleford

yokosuma could you post the content of your script?

I've discovered that this problem is not with 1903 specifically. I've reproduced the problem on 1803 and 1809. QLC+ won't launch cmd.exe or any batch file.

I have batch files working from QLC+ 4.12.2 on one computer running Windows 10 1803. Script is as follows:
systemcommand:"U:\qlc switch test.bat" arg:

It might be worth noting that the U: drive is a network share. I tried putting a .bat on a network share on the computer running 1809 just in case that helped and it did not.

I fired up a VM running 1803 and I can't launch cmd.exe or a batch file. I don't know how this can be so inconsistent. I have no idea what's special about my office computer that allows it to work.
User avatar
GGGss
Posts: 2741
Joined: Mon Sep 12, 2016 7:15 pm
Location: Belgium
Real Name: Fredje Gallon

It can be that your Office Administrator disabled all uses of .cmd and .bat since these pose a security risk?
All electric machines work on smoke... when the smoke escapes... they don't work anymore
tli
Posts: 9
Joined: Tue Sep 24, 2019 4:42 am
Real Name: Rusty Shackleford

Please reread my last post. I said my office computer (connected to a domain) is the only computer that DOES WORK.
User avatar
GGGss
Posts: 2741
Joined: Mon Sep 12, 2016 7:15 pm
Location: Belgium
Real Name: Fredje Gallon

aha ... that is progress...
My machines all are PRO versions of windows - so they all like a domain (if one is connected)
Did you try to find something like a GPO or Local restriction executing batch files?
All electric machines work on smoke... when the smoke escapes... they don't work anymore
tli
Posts: 9
Joined: Tue Sep 24, 2019 4:42 am
Real Name: Rusty Shackleford

I've discovered that it's at least partially related to the contents of the batch file. QLC+ appears to skip any line in a batch file that doesn't call an executable (except for a goto command). Unfortunately the entire reason one would write a batch file for a QLC+ script function is to do something other than call an executable.

For example, this batch file opens mspaint.exe but does nothing else. It successfully jumps past opening calc.exe but does not perform the timeout command or the ECHO command and does not pause - or if it does, the cmd window is hidden.

goto donothing
"C:\Windows\System32\calc.exe"
:donothing
"C:\Windows\system32\mspaint.exe"
timeout /t 30
ECHO what?
pause

This is really unfortunate and I think I'm going to have to explore different avenues to allow my users to launch a task from QLC+. I'd appreciate it if others could experiment with my batch file written above and attempt to replicate my results. You can use the syntax systemcommand:"C:\Users\yourprofile\Documents\stupid.bat" when doing so.
tli
Posts: 9
Joined: Tue Sep 24, 2019 4:42 am
Real Name: Rusty Shackleford

I've found a workaround!

For those of you wanting full Windows batch functionality via a QLC+ function, create a task in the Windows task scheduler and then create a script function using the schtasks.exe /run command. I'll provide my example:

systemcommand:"c:\windows\system32\schtasks.exe" arg:/run arg:/tn arg:EODmute

The EODmute task in the Windows task scheduler simply runs the batch file I created. I believe this solves my problem.
keukenrol
Posts: 47
Joined: Thu Oct 01, 2020 5:50 pm
Location: Belgium
Real Name:

Is there another method of calling a single line BAT file? Mine just calls python to run a script, but it does not work calling the bat file from QLC+. Ideally, the script can be a python script directly in QLC+.
Tried this too without luck:
systemcommand:"C:\Program Files\Python39.exe" arg:"C:\effects\scripts\scene1.py"

EDIT:
This works for me:
systemcommand:python.exe arg:"C:\effects\scripts\scene1.py"
Post Reply