Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Windows Media Service SDK

Status
Not open for further replies.

ccherchi

Programmer
Jun 18, 2002
14
FR
Hi,

I have to make a VBS script that will run once a day for maintenance needs on a Windows Media Server.

This script must create an Instance of the Station Control Object before sending command to it.

However, the SDK reference guide say that this instance have to be created within <object></object> contener, so this must be made in a HTML document.

This is a working example :

<html>
<head>
</head>
<body bgcolor=&quot;#FFFFFF&quot; onLoad=&quot;init()&quot;>
<object id=NSstationMgr classid=CLSID:B00464B3-67D4-11D0-A464-00C04FC29CFB></object>
<script language=&quot;VBScript&quot;>
NSstationMgr localhost
</script>
</body>
</html>


The problem is that i cannot use html for my script because it will be executed as a Windows scheduled task. How can i create this instance within a .VBS document ?

Thanks a lot.

Ced.
 
Hmm...

That doesn't seem quite right but I have no experience with managing Windows Media Server. I can't imagine why you'd need to host the control in HTML, or why a WSH script couldn't use CreateObject() on it either.

But you might try making a .WSF WSH script instead of a simple .VBS because it supports an <object> element that can be used to define objects by GUID.

Look at and also read up on the structure of a .WSF file. These can also use a <reference> element, that is useful because it makes constants compiled into objects available too, avoiding using a lot of &quot;magic numbers&quot; or typing in those long lists of constants.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top