NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Windows v
« Previous 1 … 51 52 53 54 55 … 102 Next »
Nscripthelper

 
  • 0 Vote(s) - 0 Average
Nscripthelper
jcjefferies
Offline

Posting Freak

UK, North Gloucestershire
Posts: 1,220
Threads: 140
Joined: Jan 2011
#1
2020-04-09, 02:11 PM
I wrote the batch file below many years ago to go in the postUpdateEPG.bat to reboot the server when it is not recording. It does not work in V5 so assumed it was just a case of changing the file location in the "set" statement but nscripthelper is now a dll file and it fails with Unhandled Exception. Is it possible to get this script working under V5?

Chris

********************************************************
REM Reboot if not recording
set NSHelper=c:\"program files (x86)"\npvr\nscripthelper.exe

:check
FOR /F "tokens=*" %%i in ('%NSHelper% -isinuse') do SET condition=%%i
echo %condition%
IF %condition% =="NOT RECORDING" goto reboot

:delay
sleep 60
goto check

:reboot

echo "About to reboot"
shutdown /r
NextPVR Server - HP N54L Microserver, Windows 10 - Storage 2 X 3TB - Tuners DVBSky S952 Twin DVB-S/S2 PCIe, Hauppauge Twin DVB-T2 USB, Telestar Digibit R1 Sat>IP Server.
Clients:- 2 X RPi3, 1 X RPi4 and Acer RL80 Celeron Nettop all running NextPVR New Client on LibreElec.
Graham
Offline

Posting Freak

UK
Posts: 4,058
Threads: 102
Joined: Dec 2005
#2
2020-04-09, 02:18 PM
(2020-04-09, 02:11 PM)jcjefferies Wrote: ... nscripthelper is now a dll file ...

The usage is now ... dotnet nscripthelper.dll -option ...

You will need the Net Core runtime ... https://dotnet.microsoft.com/download
.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,146
Threads: 958
Joined: May 2006
#3
2020-04-09, 02:21 PM
You need to to install the netcore 3.1 runtime and run

dotnet NScripthelper.dll

Note: JavaWiz seems to have indicated that your old script may not have been very useful hopefully his comment is no longer true

https://forums.nextpvr.com/showthread.php?tid=53211

Martin
jcjefferies
Offline

Posting Freak

UK, North Gloucestershire
Posts: 1,220
Threads: 140
Joined: Jan 2011
#4
2020-04-09, 03:34 PM
Thanks both for the help. I have seen mention of dotnet previously and did wonder if it was something like that.
I have not looked at it for years and it has certainly being rebooting the server as occasional late night failed recordings have not carried over to the next day but will check if it has been waiting before rebooting!. Martin I will check out the link you mentioned later .

Thanks again
Chris
NextPVR Server - HP N54L Microserver, Windows 10 - Storage 2 X 3TB - Tuners DVBSky S952 Twin DVB-S/S2 PCIe, Hauppauge Twin DVB-T2 USB, Telestar Digibit R1 Sat>IP Server.
Clients:- 2 X RPi3, 1 X RPi4 and Acer RL80 Celeron Nettop all running NextPVR New Client on LibreElec.
jcjefferies
Offline

Posting Freak

UK, North Gloucestershire
Posts: 1,220
Threads: 140
Joined: Jan 2011
#5
2020-04-09, 04:38 PM
I installed .NET Core Runtime 3.13 is that the correct software?
When I run:-
dotnet "C:\Program Files\NextPVR\nscripthelper.dll" -isinuse

I get error saying it cannot find any .NET Core SDKs.
dotnet --info says I have no SDKs installed!

Chris
NextPVR Server - HP N54L Microserver, Windows 10 - Storage 2 X 3TB - Tuners DVBSky S952 Twin DVB-S/S2 PCIe, Hauppauge Twin DVB-T2 USB, Telestar Digibit R1 Sat>IP Server.
Clients:- 2 X RPi3, 1 X RPi4 and Acer RL80 Celeron Nettop all running NextPVR New Client on LibreElec.
jcjefferies
Offline

Posting Freak

UK, North Gloucestershire
Posts: 1,220
Threads: 140
Joined: Jan 2011
#6
2020-04-23, 01:51 PM
Returning to this problem the earlier “SDK” error message disappeared after I installed the x64 version of Dotnet! The commands below gave output of “Recording” or “Not Recording”!

cd C:"\Program Files\NextPVR"
dotnet NScriptHelper.dll -isinuse

Below is the modified PostUpdateEPG.bat file for V5 which reboots the server after an EPG update if the server is not recording. The earlier version dated back to Vista where I found it reduced the number of occasional "Failed" recordings especially annoying if you have not used NextPVR for a day or two then you could find a string of failures! :-

echo off
REM Reboot if not recording
cd C:"\Program Files\NextPVR"
set NSHelper=dotnet NScriptHelper.dll -isinuse
:check
FOR /F "tokens=*" %%i in ('%NSHelper% -isinuse') do SET condition=%%i
echo %condition%
IF %condition% =="NOT RECORDING" goto reboot
:delay
timeout 60
goto check
:reboot
echo "About to reboot"
shutdown /r
NextPVR Server - HP N54L Microserver, Windows 10 - Storage 2 X 3TB - Tuners DVBSky S952 Twin DVB-S/S2 PCIe, Hauppauge Twin DVB-T2 USB, Telestar Digibit R1 Sat>IP Server.
Clients:- 2 X RPi3, 1 X RPi4 and Acer RL80 Celeron Nettop all running NextPVR New Client on LibreElec.
HarryH3
Offline

Posting Freak

U.S.A
Posts: 925
Threads: 56
Joined: Mar 2006
#7
2020-05-24, 06:31 AM
I'm trying to use the PostUpdateEPG batch file from post #6, but it exits with "Login failed". What step is trying to login to something?

echo off
REM Reboot if not recording
cd C:"\Program Files\NextPVR"
set NSHelper=dotnet NScriptHelper.dll -isinuse
:check
FOR /F "tokens=*" %%i in ('%NSHelper% -isinuse') do SET condition=%%i
echo %condition%
IF %condition% =="NOT RECORDING" goto reboot
:delay
timeout 60
goto check
:reboot
echo "About to reboot"
shutdown /r
i3-3570k, 8GB RAM, Win10 Pro, Nvidia GT710, HDHomeRun (OTA), NPVR 6.x
On a clear disk, you can seek forever...
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,802
Threads: 769
Joined: Nov 2003
#8
2020-05-24, 07:43 AM
Are you using the default 0000 pin, if not "-pin:1234"
HarryH3
Offline

Posting Freak

U.S.A
Posts: 925
Threads: 56
Joined: Mar 2006
#9
2020-05-24, 02:46 PM (This post was last modified: 2020-05-24, 02:47 PM by HarryH3.)
(2020-05-24, 07:43 AM)sub Wrote: Are you using the default 0000 pin, if not "-pin:1234"
Thanks sub, I didn't even know that was required.  My old script just worked in V4, but that was using the .exe version of NScriptHelper.  Smile

I modified this line to pass the pin:

set NSHelper=dotnet NScriptHelper.dll -isinuse -:pin:xxxx

Now it works as I expected.  Smile
i3-3570k, 8GB RAM, Win10 Pro, Nvidia GT710, HDHomeRun (OTA), NPVR 6.x
On a clear disk, you can seek forever...
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#10
2020-05-24, 02:50 PM
If you are interested, I've written a helper utility that makes interacting with NScriptHelper easier from cmd or shell scripts.  It can be found on this thread.  You'll still have to fix the pin issue however.

Your code for detecting a recording in-progress would be something like this:

Code:
:Check
  python3 NPvrHelper.py --isrecording
  if %ERRORLEVEL%==0 GoTo :Reboot
  ... delay ...
  GoTo :Check

:Reboot
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (3): 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  nscripthelper in V7.0.0.241105 PRBUK 3 513 2024-12-17, 10:42 PM
Last Post: mvallevand
  How Run NScriptHelper.dll windows 11 NextPVR V6 bertiverson 3 984 2022-10-24, 05:09 PM
Last Post: bertiverson
  EPG Update via command line nscripthelper failing .net error spe109 8 3,557 2021-04-03, 03:41 PM
Last Post: spe109
  updateepg using NScriptHelper is not allowed after recent V5 release upgrade fwpvr789 5 1,896 2020-06-13, 09:50 PM
Last Post: fwpvr789
  dotnet "C:\PROGRA~1\NextPVR\NScriptHelper.dll" -Rename does not rename pascalb 16 4,165 2020-05-25, 06:47 AM
Last Post: pascalb
  NScriptHelper.dll jcole998 35 8,596 2020-02-14, 07:26 PM
Last Post: jcole998

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

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

Linear Mode
Threaded Mode