- January 15, 2009
- 16
- 0
- Home Country
-
United States of America
I frequently admin my HTPC via RDC. I'm looking for a clean VBScript way of shutting down MediaPortal if it is running when I connect via RDC.
Basic concept would be, call the VBScript from the RDC client under the Programs tab, "Start the following program on connection"
My reasoning is, since RDC is only capable of supporting 16-Bit Colors MediaPortal doesn't react well when I RDC in.
I tried this, which works, but causes MediaPortal to start the crashed unexpectedly window:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'MediaPortal.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
Well, I got my Dameware working and it supports 32Bit, so Soultion in't really needed, unless others need it.
Basic concept would be, call the VBScript from the RDC client under the Programs tab, "Start the following program on connection"
My reasoning is, since RDC is only capable of supporting 16-Bit Colors MediaPortal doesn't react well when I RDC in.
I tried this, which works, but causes MediaPortal to start the crashed unexpectedly window:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'MediaPortal.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
Well, I got my Dameware working and it supports 32Bit, so Soultion in't really needed, unless others need it.