The other problem was with this line:
WshShell.Run "Media Center 18.exe /MCC 10037, 1"
Even ignoring the "mc18.exe" versus "Media Center 18.exe" thing, there is another potential issue with that. It may not impact your particular usage, Arcturus, but since I'm posting this, I figured I'd help everyone. If you only have one zone, then you can omit the zone specifier for this command. But if you want to direct the command to a particular zone, then you need to add a zone specifier to it.
The
way you specify zones with the MCC commands is by adding a : to the end and then list the zone index. There are other crazy bitwise ways to do it by ORing against the zone specifier, but that's a dumb (hard, old) way to do it (though we probably still need to do it that way with commands sent via Windows Message, unfortunately, I need to check later). Now, you can just do this, for any MCC command that impacts "playback" or other zone-specific operations:
Here's the "normal" command:
MCC 10037, 1(Details: In this, the "MCC 10037" part is the "detach display" command itself (MCC_DETACH_DISPLAY), and the ", 1" part is an argument to that that tells it what mode to use when detaching. If you send -1, it toggles back and forth. If you send 1, it detaches regardless of the current state.)Zone specific version:
MCC 10037, 1:0In this, it is the part after the colon that specifies the zone. This is a zero-based index, which just means that it counts starting from 0 instead of 1 like normal humans. So, Zone 1 = 0, Zone 2 = 1, Zone 3 = 2, and so on and so forth.
With that, you can have it detach on any of your zones. If you wanted to open MC, and then detach the displays for zones 1-4, you'd use this script:
<package>
<job id="vbs">
<script language="VBScript">
'Create our handy dandy Shell object
set WshShell = WScript.CreateObject("WScript.Shell")
'SCRIPT ACTUALLY STARTS DOING STUFF HERE
'Start MC
WshShell.Run "mc18.exe"
'Pause for a bit
WScript.Sleep 1000
'Detach display on Zone 1
WshShell.Run "mc18.exe /MCC 10037, 1:0"
'Detach display on Zone 2
WshShell.Run "mc18.exe /MCC 10037, 1:1"
'Detach display on Zone 3
WshShell.Run "mc18.exe /MCC 10037, 1:2"
'Detach display on Zone 4
WshShell.Run "mc18.exe /MCC 10037, 1:3"
</script>
</job>
</package>
(Of course, it would be better in this kinds of instances to use a for/next loop or something, instead of just copying the line over and over, but this will work in a pinch if you aren't a coding expert and you don't have a ton of zones to handle.)
In my opinion, if you are writing a script like this, even if you DO only have one zone to deal with, you might as well add the Zone Identifier to the command anyway. That way, in the future if you add additional zones, you won't have to go in and muck with your script. The only time I omit the Zone Identifier on zone-impacting commands (mostly the playback ones), is when I'm really sure I want the command to be "universally applied" to whatever zone
happens to be active at the time (which is how it works when you omit the zone specifier).
Hope this makes everything more clear for everyone!