Code Monkey home page Code Monkey logo

Comments (8)

jpmens avatar jpmens commented on August 16, 2024

Good question. It's likely going to be something like this in the program arguments bit of the configuration (compare with the README.md):

[ 'cmd.exe', '/c', '/path/to/my.bat' ],

You're going to have to check the syntax of cmd.exe (I'm doing this from what I remember was 20y ago :-)

from mqtt-launcher.

ArhAngeL3000 avatar ArhAngeL3000 commented on August 16, 2024

Thanks for the quick response!
I tried your version, and several others.

No results so far. I will describe the options below. With the first, nothing simply happens, and with the other two, the script does not run at all.

`topiclist = {
    # topic                     payload value       program & arguments
    "infierno/switch" :	{
									'1'			:   [ 'cmd.exe', '/c', "C:/Users/messe/Desktop/MQTTLauncher/hello.bat" ],
									#'2'			:	[ 'from subprocess import Popen', 'p = Popen("hello.bat", cwd=r"C:\Users\messe\Desktop\MQTTLauncher")' ],
									#'3'			:	[ 'p = subprocess.Popen("C:\\Users\\messe\\Desktop\\MQTTLauncher\\hello.bat assembleRelease", cwd="C:\\Users\\messe\\Desktop\\MQTTLauncher\\", creationflags=subprocess.CREATE_NEW_CONSOLE)' ],
                        },
}`

from mqtt-launcher.

jpmens avatar jpmens commented on August 16, 2024

You are trying to execute Python code in #2 and #3. That cannot work.

from mqtt-launcher.

jpmens avatar jpmens commented on August 16, 2024

Have you tried

[  "C:/Users/messe/Desktop/MQTTLauncher/hello.bat" ],

from mqtt-launcher.

ArhAngeL3000 avatar ArhAngeL3000 commented on August 16, 2024

Yes, I tried it.
The log file displays a line and nothing happens.

Running t=infierno/switch: ['C:/Users/messe/Desktop/MQTTLauncher/hello.bat']

from mqtt-launcher.

ArhAngeL3000 avatar ArhAngeL3000 commented on August 16, 2024

Good day!
I thought that the Python language cannot be used in the commands of the configuration file. Is it possible to make links to lines of code in the mqtt-launcher.py script itself?
Then it will be possible to run .bat files using Python syntax?

from mqtt-launcher.

jpmens avatar jpmens commented on August 16, 2024

No, neither is possible. Of course if you are able to you can alter your version of mqtt-launcher to provide that capability.

I don't think anybody's ever tried to do this on Windows (I certainly have not), so unfortunately you're on your own. Good luck.

from mqtt-launcher.

ArhAngeL3000 avatar ArhAngeL3000 commented on August 16, 2024

OK.
Thanks for the help!
I will look for other solutions.

from mqtt-launcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.