[SOLVED] How to run VBS scripts on windows Machine

Hi i am runing OH on windows machine, can i use Exec to run VBS script on the pc that is runing OH?
also if anyone has any idea how to contorl VLC that is runing on that PC?

so lets say if want a full autuamted PC for movie or gaming needs

thanks allot!

If you can run it from the cmd prompt you can run it using exec. You may need to use full paths to things though.

i have tried to follow the guide but i dont get it,maybe becuse i am windows user :slight_smile:
i missing the thing i need to do in things file, if can please help me with syntex
i just want to be able to run simple script

lets say its on C:home.vbs


Switch YourTrigger

Switch item=YourTrigger

by the way i was just on colordo springs!!! more in Lone tree

The full syntax with examples are in the README.


I love this part of the country. I hope to never have to move away.

already been throgh all the guides :frowning:
still not able to make it run
and nothing in the logs

Switch YourTrigger { channel=“exec:command:myscript:run”}

Thing exec:command:myscript [command=“vbs ./conf/scripts/XGame.vbs %2$s”, interval=0, autorun=false ]

if you can please tell me what i am missing here

I really don’t use this binding and have never used it on windows.
What is in the logs when you trigger the item?

no error just the value changing from 1 to 0

Which logs are you looking at? You should be seeing lines in openhab.log that shows what the script is returning.

My last advice is to try How to solve Exec binding problems

Hi its working!

i will try to put here my wisdom :slight_smile:

  1. install Exec

  2. things file
    Thing exec:command:myscript [command=“amd”, interval=0, autorun=false ]

  3. Items
    number YourTrigger { channel=“exec:command:myscript:run”}

  4. the file is a VBS script compiled to EXE with a freeware

  5. put the file in C folder

  6. configre env varibles , so AMD file will run as native app

  7. reboot all , windows and open hab for sure

  8. working for me if anyone needs help

Trouble shooting:

  1. if you are able to run calc with no issue you are on step 4
    Thing exec:command:myscript [command=“Calc”, interval=0, autorun=false ]

  2. if you are not able to run Calc i cannot help you for me exec worked OOB, only had issue with syntex and type of file i am runing

hopes this will help someone