PlexConnect as Windows Service

Seems to be working well.

What about ATVSettings.cfg? I setup the PlexConnect service to autostart on bootup, I stopped it manually once to create the ATVSettings.cfg, will it now work correctly if I just reboot my PC, without stopping the PlexConnect service manually? I downloaded and installed the latest PlexConnect this morning and also pywin32.

Seen that? ->https://forums.plex.tv/topic/98904-plexconnect-as-windows-service/?p=583492

Give it a try - reboot you machine - check the file date/modification time - report back... I really would like to know :-D

Yes!! I made a couple of changes to the settings on my ATV3, just in case, then rebooted my PC and on boot up the ATVSettings.cfg had the correct timestamp (for when I initiated the reboot) and PlexConnect was running as a service and worked fine on my ATV. Looks like it works :)

Sounds good. Thank you!

Added wiki page and edited op to link to it

Would could be wrong here? 

>python PlexConnect_Winservice.py install
Installing service PlexConnect-Service
Service installed

sc query PlexConnect
[SC] EnumQueryServicesStatus:OpenService FAILED 1060:

The specified service does not exist as an installed service.

python PlexConnect_WinService.py remove
Removing service PlexConnect-Service
Service removed

python PlexConnect_WinService.py remove
Removing service PlexConnect-Service
Error removing service: The specified service does not exist as an installed service. (1060)

It says it installs and also start/stop seem to "work", but PlexConnect does not actually start. (batch files have same result)

@bakman1 -- The service name for the sc command is "Plexconnect-Service".

Question: I was unable to get the batch files to run correctly due to an error with python not being recognized (confirmed path variable set).  Therefore, I executed "Plexconnect_WinService.py install" from an elevated command prompt.  Will Plexconnect still function correctly with autostart since I did it this way?

Hello,
 
i have a problem starting the service´, see screenshot

http://de.tinypic.com/r/2cilw2/8

I already searched for this error, but all i can find that something is wrong with the path in the Service-Registry. But it seems the path is right.

See three more helpful screenshots:

http://www.directupload.net/file/d/3547/q3fiiyl8_jpg.htm

http://www.directupload.net/file/d/3547/xkb5uvkv_jpg.htm

http://www.directupload.net/file/d/3547/ivgs2ax2_jpg.htm

It would be really nice if you can fix my problem, because this is the most wanted feature by me.

I wanted to setup the service to launch on my Windows 7 laptop using the Task Scheduler. No matter what I tried, it didn't seem to want to launch. The scheduler would show task as "Queued" no matter what I did. I imagine you all may know this, but just in case someone doesn't, hopefully it'll help.

Setup the task as usual, but when you get to the part where you browse to the .bat file to "start" the service, do the following instead:

In the Program/Script box, type     cmd

In the "Add Arguments (optional)" box, type       /c start "PlexConnect" "C:\Program Files (x86)\PlexConnect\support\Win>stop.start"

"PlexConnect" can be whatever you want - it's just a placeholder to prevent an error from popping up in the cmd window when the scheduler tries to start the server.

My task is setup to run when any user logs in, and to check it in 1 hour intervals. I have it set to "run with highest privileges" as well.

I have it set to repeat the task every 1 hour indefinitely.

Once I did this the scheduler ran perfectly on restart or logoff/login. The cmd window pops up and confirms the service is running. Hope this helps someone that may be having the same issue.

I ran into some issues as well during this install, maybe you can help me out!:

No thoughts on this? :(

No - no idea.

As far as I know, "echo off" is a valid DOS command, originating back in the days where nobody even thought about Windows... it should work on your machine as well.

Two things:

- what's the help text about, when you type "echo /?" in the command window? Does it give a reference to the options on/off?

- if you don't care each line being printed during the installation process, just remove the offending line completely. It is not really needed, just cleans up the batch file output...

echo off is a valid windows command, however it looks to me like bashenneman is trying to run a windows batch file from python

Which won’t work,


Current command

Python install.bat

Should be

Install.bat

There must be something simple I'm missing. I downloaded the latest build of PyWin for 32bit for python 2.7 which is what I have. I installed that, during the install it found python in the registry and I told it to use that. Now I run the cmd window as admin and run the install bat from the plexconnect support and I was getting "python is not recognized as a valid internal or external command." I deleted python out of the bat, now I get the error 'c:\program" is no recognized as an internal or external command. Did I need to instert an install path in the install.bat? this is my install.bat

@echo off

set installerpath=%~dp0

set plexconnectpath=%InstalerPather%..\..\

%plexconnectpath%plexconnect_winservice.py install

echo plexconnect-service installed

I used % to replace the symbal in the bat I couldn't find the symbol for, I had to type it since I couldn't paste into this reply window.

of course, right after I type that I tried one last thing, I put parenthesis in "%plexconnectpath%plexconnect_winservice.py"

now to reboot and see if the service works now that it installed

it didn't work at first. I opened up task manager (I'm on windows 7 x64), by hitting ctrl alt del and then selected the services tab. Then I clicked on the admin icon labeled services in the bottom right which brought up a windows with all possible service, whther they're currently running or not. I found plexconnect in there, right clicked and hit properties and set the startup type to automatic. That did it, now it works fine.

Question:

After running the .bat install file I am unable to see the service listed under the services.msc list. Starting and stopping the PlexConnect.py appears to be working otherwise; content is able to be played on ATV.

I am able to see the 4 .bat files in the "support/Win" directory. Wondering if this is expected or if I may have missed a step in setup process. 

Settings:

  • Windows 7x64
  • PMS 0.9.9.7
  • Python 2.7.6
  • Pywin32-217.win-amd64-py2.7

both guys above, read this post: https://forums.plex.tv/topic/98904-plexconnect-as-windows-service/#entry580598

I had the same and that fixed it

i ins

EDIT: Full instructions for PlexConnect as a windows service can now be found on this wiki page.

Hey Guys,

For those that haven't seen this yet, It works really well! nice work to those involved :rolleyes:

If you grab the latest git and install pywin32 you can run PlexConnect as a service on windows

startup.

i'm just using the Task Scheduler to grab the latest git and then start the service (i assume this is the best way?)

start-plexconnect.bat

C:
cd \plexconnect
git pull
python PlexConnect_Winservice.py start

Cheers Rob.

i installed pywin32-219.win32-py2.7.exe but .bat files are not showing up in my C:\PlexConnect\support\Win folder. can you help?

will this run when i start up the pc in the background so i dont have to see the command prompt window open when it is running?

>> are not showing up in my C:\PlexConnect\support\Win folder.

​Hm. They are part of the github project, why would the be missed on your machine?

>>will this run when i start up the pc in the background

Yes, that's what services are good for.