NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Legacy (v4.x and earlier) v
« Previous 1 … 32 33 34 35 36 … 433 Next »
Run custom .bat file at start and end of recording

Run custom .bat file at start and end of recording
bm_00
Offline

Junior Member

Posts: 7
Threads: 3
Joined: Jan 2019
#1
2019-01-08, 01:35 AM
I am looking to run a custom .bat file when next pvr begins recording and when it ends recording. I stumbled upon the ability to add .bat files to the scripts folder under the data folder. I saw that the PararellProcessing.bat and PoatProcessing.bat scripts are run at both the beginning and end of recording. I simply copined and renamed my custom .bat files to the folder under the correct names but they do not run when recording begins. Is there something I am missing? Do the .bat files need a special layout? The ones I am trying to run are scripts to turn on and off an led via a program. The .bats work when perfectly when run on their own.
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,735
Threads: 767
Joined: Nov 2003
#2
2019-01-08, 01:39 AM
ParallelProcessing.bat is run at the start of a recording. Postprocessing.bat is run at the end of a recording.

These processes are run by the Recording Service, which is running as the 'localsystem' account which sometimes trips people up when they're trying to do custom. For example, if your LED control utility uses WM_COPYDATA (aka the clipboard) to send messages to some server process, those messages wont make it there, because the two processes will be running in a different desktop session.
BrettB
Offline

Posting Freak

Saint Paul, MN, USA
Posts: 2,667
Threads: 170
Joined: Jun 2007
#3
2019-01-08, 01:47 AM
sub Wrote:These processes are run by the Recording Service, which is running as the 'localsystem' account which sometimes trips people up when they're trying to do custom. For example, if your LED control utility uses WM_COPYDATA (aka the clipboard) to send messages to some server process, those messages wont make it there, because the two processes will be running in a different desktop session.

I believe that a couple of other things the often trip up people is not explicitly setting the default directory (i.e. a "CD" command in the batch file) and not providing the full path to any things that might be called in the batch file.
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,735
Threads: 767
Joined: Nov 2003
#4
2019-01-08, 01:54 AM
Yes, that's true - incorrect assumptions about the default directory often lead to things not being found etc too.
bm_00
Offline

Junior Member

Posts: 7
Threads: 3
Joined: Jan 2019
#5
2019-01-08, 05:29 PM
sub Wrote:ParallelProcessing.bat is run at the start of a recording. Postprocessing.bat is run at the end of a recording.

These processes are run by the Recording Service, which is running as the 'localsystem' account which sometimes trips people up when they're trying to do custom. For example, if your LED control utility uses WM_COPYDATA (aka the clipboard) to send messages to some server process, those messages wont make it there, because the two processes will be running in a different desktop session.

That makes some sense. After a little more research I discovered that whatever command I add to the batch file does appear to run as it appears task manager (cmd for the led and I tried just notepad for testing which must be due to the different desktop user sessions. I know the Recording Service runs as the system account but is there anyway to somehow run the .bat as a different user? Thanks
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,735
Threads: 767
Joined: Nov 2003
#6
2019-01-08, 05:33 PM
bm_00 Wrote:I know the Recording Service runs as the system account but is there anyway to somehow run the .bat as a different user?
No, but you could try changing the account the recording service runs as.
bm_00
Offline

Junior Member

Posts: 7
Threads: 3
Joined: Jan 2019
#7
2019-01-08, 06:32 PM
sub Wrote:No, but you could try changing the account the recording service runs as.

Would this be achieved by going to services--> NPVR Recording Service--> Properties--> Log on than enter my username and password?
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,735
Threads: 767
Joined: Nov 2003
#8
2019-01-08, 06:59 PM
yep, that's the one.
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,735
Threads: 767
Joined: Nov 2003
#9
2019-01-08, 06:59 PM
Alternatively, for a test, you can stop the service, and just run "nrecord.exe RUN" from the command line, and see if it then works.
bm_00
Offline

Junior Member

Posts: 7
Threads: 3
Joined: Jan 2019
#10
2019-01-08, 09:34 PM
sub Wrote:yep, that's the one.
I have tried modifying the service but when I both type in and search for the correct username and enter the correct password and try to restart the service it throws an error of 1069 login failure. Research shows that usually means an incorrect password but it is the right one as its the same I use to login
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Recording movies / TV to XBMC directory stucture spinnaker 10 3,576 2024-06-03, 03:56 AM
Last Post: Rod Hutchinson
  Not recording errors vidwiz 4 1,017 2024-04-17, 05:39 PM
Last Post: mvallevand
  Add Series/Episode Info to Recording Metadata andrewj 2 1,088 2023-11-20, 03:42 PM
Last Post: sub
  incorrect frequency in adelaide .ini file spin35 5 3,051 2023-02-01, 05:40 PM
Last Post: sub
  Recording to a network drive woes. 2leftfeet 12 7,230 2022-04-05, 08:03 PM
Last Post: mvallevand
  All my recordings start 90 sec early ncsercs 2 1,368 2022-03-19, 03:28 AM
Last Post: sub
  device needed for recording David209 2 1,742 2021-04-04, 08:47 AM
Last Post: David209
  PC not going to sleep after recording LeoL 7 3,296 2021-04-01, 07:17 PM
Last Post: Handy.Man
  HDHomerun recording bizzarely not working Jean0987654321 3 2,046 2021-03-27, 03:23 PM
Last Post: Jean0987654321
  ts file shows length too long? SuttonWillow 2 1,919 2021-03-15, 01:56 PM
Last Post: mvallevand

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

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

Linear Mode
Threaded Mode