NextPVR Forums

Full Version: Strange problem with PostProcessing and PsExec
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm at witt's end here so hopefully someone can help. I have this peace of code in PostProcessing.bat:
Code:
set iFN="\\Sirius\sirius$H%~pnx1"
set oFN="\\Sirius\sirius$H%~pn1.avi"
set SRT="\\Sirius\sirius$H%~pn1.default.srt"
echo C:\ffmpeg\bin\ffmpeg.exe -analyzeduration 2147483647 -probesize 2147483647 -y -i %iFN% -vcodec libx264 -preset fast -acodec copy %oFN%>c:\Users\Public\npvr\scripts\Convert.bat
copy c:\Users\Public\NPVR\Scripts\Convert.bat \\Taurus\Users\Public\NPVR\Scripts\
C:\windows\system32\psexec \\Taurus -d -c -e -h -f -u xxxxxx -p xxxxxx -w C:\Users\Public\NPVR\Scripts C:\Users\Public\NPVR\Scripts\Convert.bat
In short, the code produces a batch file, Convert.bat, which is copied to a remote computer (Taurus), the purpose of this bat is to convert an mpeg2 recording to h.264. The conversion batch is written and works beautifully, the file is copied to the remote computer with no problems. BUT, the PsExec call does nothing when called from PostProcessing when Nrecord starts it.
I can execute PsExec with all the parameters manually in a command prompt and it works great. So I thought, wait a minute, Nrecord is a service, maybe it is not allowed to run PsExec (I should add that Nrecord runs as my user and not the local system account). So I tried to run Nrecord in a command prompt with "Nrecord RUN". No dice, the PostProcessing runs but not PsExec. I tried both with "Run as Administrator" and without.
So, I try to run PostProcessing with all its parameters from a command prompt, and VIOLA, PsExec works.

Sub, does Nrecord run PostProcessing with any limitations with regard to privileges or something like that?? Anyone else have a clue?:confused:
Reddwarf Wrote:Sub, does Nrecord run PostProcessing with any limitations with regard to privileges or something like that??
No, it's not limited any way. It just runs the batch file as the same user as the recording service. You an do anything from your batch file, which that account would normally be able to do.
If psexec was located in a folder other than under c:\windows and called from the new location, does it work?

I had similar problems in updating my EPG from EPGcollector when NPVR calls it using EPGUpdate.bat. No go under Win8.1 (but the same routine worked under Win7), however if I put EPGUpdate.bat it into the windows task scheduler to run at 11:00pm, it runs fine. Its like some privilage is required or the folder needs a share, but I never got to the bottom of it.
Try NRecord RUN > file 2>&1 to maybe capture an error message.

Martin
Thanks guys, I'll try both and report back tomorrow.
I vaguely remember coming across this in an old script.

I believe since you are running in postProcessing.bat, you are running under the serviceID, not your login id. On first execution of psExec, each user running must accept the eula. When running via ServiceID it hangs on the prompt to accept eula. Whereas the first time you ran it interactively, you accepted the prompt. Here is a thread that describes the fix.

see if it works with the command line parm -accepteula as below:

Code:
C:\windows\system32\psexec [B]-accepteula[/B] \\Taurus -d -c -e -h -f -u xxxxxx -p xxxxxx -w C:\Users\Public\NPVR\Scripts C:\Users\Public\NPVR\Scripts\Convert.bat
Ok, I'v solved the problem. The PsExec.exe came from a downloaded .zip file so when I looked at the properties in windows explorer it said that the file was blocked for security reasons. Unblocking it did not help, so I tried to copy the file to npvr's script directory, but explorer claimed that it did not find the file. Copying it from a command prompt worked and when I execute it with -accepteula from the script firectory everything works. Something is fishy in windows filesystem. Thanks for the help guys Smile
antiviruses often pickup that executable as a virus...
you only need to run that switch once[accepteula], it will remember for subsequent runs..
pBS Wrote:antiviruses often pickup that executable as a virus...
you only need to run that switch once[accepteula], it will remember for subsequent runs..
Yeah, I know about the -accepteula, but it doesn't hurt to let it stay there. No if my antivirus (Avira) had reacted to I would have gotten a message, Avira shouts loud and clear when it suspects a virus Big Grin