Jump to content

Run Program Using REST from Batch File


zerop

Recommended Posts

Posted

Is it possible to run programs using the REST from a windows batch file?

 

I've got Tasker working on my Android phone using REST to run several programs so I know the basic setup for it, but I don't know how to do it from a batch file on Windows 7 64-bit.  If it's possible could someone point me in the right direction or is it pretty complicated?

Posted (edited)

Hi zerop,

 

/rest/programs/<id>/<cmd>

 

Example:

 

/rest/programs/0032/runThen

 

<cmd> could be any of the following:

run|runThen|runElse|stop|enable|disable|enableRunAtStartup|disableRunAtStartup

 

With kind regards,

Michel

 

Yes, I understand that but how do you initiate this in the batch file?  In Tasker I use the HTTP Get with the following:

http://username:password@IP:port/rest/programs/programID/runThen 

I can't run this same thing from the command line/batch file, it doesn't work.  Could someone provide example text for a batch file?

Edited by zerop
Posted (edited)

Batch files cannot themselves call a rest api. You'll need to find a helper binary, such as curl or wget (compiled for windows) and then use that as a command in your batch file to call the api.

Edited by MWareman
Guest
This topic is now closed to further replies.

×
×
  • Create New...