Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Running DOS batch script on Windows PC via LUA


Question

Posted

Does anyone know if it is possible to run a DOS batch script on say the C: drive of a Windows PC from within a LUA script?

5 answers to this question

Recommended Posts

  • 0
Posted

The simple way of doing it is to install a webserver on the pc (like wamp, i'm using that) and then create a php script which runs the batch using osexecute. Alternatively, you can set up a php script which does what you want instead of the batch.

Then you just have to make a http-call to the pc to run the php-script.

  • 0
  • Inquirer
  • Posted

    I have never installed a web server or written a php-script in my life, but then again 2 months ago I hadn’t written a line of LUA either, so here I go … lots of research to do

    Please login or register to see this image.

    /emoticons/default_icon_eek.gif" alt=":shock:" />

    • 0
    Guest sztywniak
    Posted

    use

    Please login or register to see this link.

    Please login or register to see this link.

    mediawiki/index.php?title=Webserver

    • 0
    Posted

    If you want something which is relatively simple and works quite well, install WAMP. It comes with some pretty good guides as well.

    For the execution of the batch, look at this:

    Please login or register to see this link.

    Executing the php is done by opening a http socket on the hc2 (several threads on it on here) then all you do is point the socket towards the address of the php on the webserver and you are sorted... It is easier than it sounds. The guides on creating a virtual device for a Phillips hue bulb will show you how to handle the http part.

    Looking back at when I got my hc2, 5 months ago, I had never done Lua, never done PHP, never done Javascripting... Now five months later I have it all down, so if you have a few hours to spare on reading up on php, you are already pretty well sorted.

    • 0
  • Inquirer
  • Posted

    Thanks for the advice guys. I will look into it over the weekend.

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...