Jump to content

HOWTO: Windows Powershell and DVBViewer


dbraner

Recommended Posts

Hi all,

 

the windows powershell is installed with Windows 7 by default. For older Windows versions it can be downloaded from Microsoft for free. To start powershell in Windows 7 simply type in "powershell" in the search field of the start menu.

 

Here is a short example how DVBViewer can be controlled by powershell:

 

$MyDVB = new-object -comobject "DVBViewerServer.DVBViewer"
$MyDVB.SendCommand(42)

 

The example above will start DVBViewer and activate channel 2 (actionid = 42). There should be no blank between SendCommand and "(42)". The command fails if DVBViewer is already running.

 

EDIT: Accessing an already running DVBViewer:

 

$MyDVB = [System.Runtime.InteropServices.Marshal]::GetActiveObject("DVBViewerServer.DVBViewer")

 

You can get a listing of all methods and properties of the $MyDVB object with the command:

 

$MyDVB | get-Member

 

For further operations see the DVBViewer COM interface documentation. It should be possible to use events too, have to test this.

Edited by dbraner
Link to comment

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   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...