NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Add-ons (3rd party plugins, utilities and skins) Old Stuff (Legacy) GB-PVR Support (legacy) v
« Previous 1 … 97 98 99 100 101 … 1231 Next »
VB script to start pvrx2

 
  • 0 Vote(s) - 0 Average
VB script to start pvrx2
TimC
Offline

Junior Member

Posts: 9
Threads: 1
Joined: Sep 2009
#1
2009-09-12, 02:11 AM
I set up one of my remote's buttons to start pvrx2 but if pvrx2 was already running it would create a new process and then switch me to the old process. I ended up with alot of pvrx2 processes if I kept hitting the button. Here's a little script that will check to see if pvrx2 is running and if it is activate it, a.k.a. bring it to the forefront. If it's not running, it will start it.

Code:
strComputer = "."
strProgramName = "PVRX2.exe"
strProgramTitle = "PVRX2"
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objShell = CreateObject("WScript.Shell")
Set colProcessList = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = '" & strProgramName & "'")

If colProcessList.Count > 0 Then
    objShell.appactivate strProgramTitle
Else    
    objShell.Run strProgramName
End If

Not very complex. Save it to a file with a vbs extension and put it in the same directory as PVRX2.
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#2
2009-09-12, 03:21 AM
it should already work that way...
my power button is mapped to pvrx2.exe, and if i hit it multiple times, it only gives focus to it, it isn't supposed to be able to start more than once...
maybe something wrong with your .net install?
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,987
Threads: 956
Joined: May 2006
#3
2009-09-12, 03:56 AM
Do you have have AllowMultipleInstance set in the registy? If so why not turn it off? If you don't, do you have some software that is blocking PVRx2 from writing its windows handle to the registry?

Martin
liteswap
Offline

Senior Member

Posts: 713
Threads: 70
Joined: Aug 2006
#4
2009-09-12, 01:32 PM
My long-established StartPVRX2 utility does this - see the sig for details.
- Silent client PVR: HDPlex HS.1 aluminium fanless case / Thin-ITX ASRock H81TM-ITX motherboard / Intel Celeron 1850T CPU / 4GB RAM / 120GB SSD / TBS6982 DBS-S2 [SIZE=1]dual-tuner card / Win10+nPVR+Plex Media Player feeding LG OLED55B6V + Anthem MRX510 AV Receiver / PMC GB1 / B&W / REL speakers.
- Noisy NAS: Xeon / Intel mobo / 16GB RAM / FreeNAS + Ubuntu VMs on VMware ESXi + 12TB RAID
[/SIZE] running Plex Media Server

TimC
Offline

Junior Member

Posts: 9
Threads: 1
Joined: Sep 2009
#5
2009-09-12, 04:46 PM
I couldn't find any information about the 'AllowMultipleInstance' registry key in the wiki or on the forums. I have a plain jane windows xp set up specifically for gbpvr so there is no software on the machine blocking anything it does.

I set up my remote with the help of pBS instructions on changing irbus.inf to open PVRX2 with one button and Boxee with another. I can switch between the two quickly and easily but before I put the script in I would end up with many PVRX2.exe processes if I kept switching between the two. I was pretty surprised myself when I opened task manager and saw 5 or 6 pvrx2.exe processes. Maybe it's a bug or maybe it's my system, but I fixed it Wink.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Exit button on StreamZap remote now exits PVRX2 billbobbins 5 5,186 2012-08-30, 09:43 PM
Last Post: billbobbins
  tv guide empty in gbpvr works in pvrx2 slowtech 37 17,264 2012-08-27, 04:00 PM
Last Post: rscheller
  Need to send key to pvrx2 greg in kansas 4 3,837 2012-07-27, 12:04 AM
Last Post: greg in kansas
  Start PC for recording, Sleep/Hibernate when done Basher52 6 4,980 2011-12-17, 02:52 PM
Last Post: Sykor
  No Signal message PVRX2 Flyndr 6 2,962 2011-06-20, 10:29 AM
Last Post: martint123
  Latest PVRX2 Download? Flyndr 2 2,514 2011-06-11, 12:58 PM
Last Post: Flyndr
  No Video in PVRX2 GUI TonySmith35 13 4,933 2011-01-09, 10:31 PM
Last Post: steevo
  PVRX2 Has Encountered A User-Defined Breakpoint BTJustice 5 3,155 2010-12-20, 04:42 PM
Last Post: sub
  Attempts to play .dvd files in Video Library results in PVRX2 not responding Jwbrit 2 2,034 2010-11-04, 11:37 PM
Last Post: Jwbrit
  PVRX2 has stopped working roguejedi 2 1,844 2010-10-09, 05:16 PM
Last Post: roguejedi

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode