TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Start VBS script from Bat file

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 1 Posters 1.5k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B Offline
      Bradley Lansink
      last edited by

      Hey I'm currently working on an automated alarm.

      I ask TriggerCMD to start a .Bat file (which works just fine). It select the audio device and sets the volume.
      Then I start a VBS script from the .Bat, And that does't work. It should open spotify and play a playlist. But it won't do anything at all.

      When I start the .Bat manually everything works like intended.

      Any Ideas?

      1 Reply Last reply Reply Quote 0
      • B Offline
        Bradley Lansink
        last edited by

        Just to clarify:

        Bat file:

        nircmd setdefaultsounddevice "VG248" 1
        nircmd.exe setsysvolume 35000
        PlayAlarmVBS.vbs

        vbs file:

        Set WshShell = WScript.CreateObject("WScript.Shell")

        Comandline = "C:\Users\Username\AppData\Roaming\Spotify\Spotify.exe"
        WScript.sleep 500
        CreateObject("WScript.Shell").Run("linktoplaylist")
        WScript.sleep 3000
        WshShell.SendKeys "{ENTER}"
        WScript.sleep 100
        WshShell.SendKeys "^{RIGHT}"

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post