New
#1
Task Scheduler and Bat File Problem
Hi,
Not sure which forum to post this in, but hopefully someone has some insight and can help me with this.
I have a simple .bat file that stops my media server, creates an archive of a folder (for backup purposes), and then starts the media server again. It works perfectly if I double click the .bat file, or if I run the bat file from the command prompt.
When I run it from Windows Task Scheduler, however, it does not work properly. The media server does not shut down. If I look in the task manager, though, I see that the archiving program has started. It is difficult to see what is happening because, unlinke when running this in CMD, when it is run from the task scheduler it produces no output to see if there is an error message.
Why would it run differently from the task scheduler than when I simply double click the .bat file? I have chosen to run it from the same user account, and also selected "run with highest privileges."
Here is the bat file. The first line stops the media server. The second line runs the archiving process (using 7zip). The third line starts the media server again. Again, it works perfectly if I simply double click the bat file.
Anyone have insight?Code:@echo off taskkill /im "plex media server.exe" 7za u C:\plexbackup.7z C:\plexdata -mx0 -up1q0r2x1y2z1w2 "C:\Program Files (x86)\Plex\Plex Media Server\plex media server.exe"
Thanks.