Windows 10: Task Scheduler and Bat File Problem

Discus and support Task Scheduler and Bat File Problem in Windows 10 Support to solve the 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... Discussion in 'Windows 10 Support' started by SeanFilidis, Jan 6, 2016.

  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.

    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"[/quote] Anyone have insight?

    Thanks.

    :)
     
    SeanFilidis, Jan 6, 2016
    #1

  2. Task Scheduler

    In Windows 10 version 1703 the Task Schedule with a .bat file will start, but does not recognize a mapped drive. If I start the .bat file manually it works fine. Prior version had no problem.

    ***Post moved by the moderator to the appropriate forum category.***
     
    RichardCobb, Jan 6, 2016
    #2
  3. MS16-100: Security update for Secure Boot: KB3172729 Seems to be causing Inaccessible Boot Device error

    If not I'll create a scheduled task on shutdown linked to a BAT file to do this in the meantime.
     
    Grubby One, Jan 6, 2016
    #3
  4. DavidE Win User

    Task Scheduler and Bat File Problem

    In Task Scheduler Enable All Tasks History
    Run the scheduled task
    Refresh, and look at the History tab for that task.
    Look at each entry in history and see if you can find an error message/code for any step in the task run.
     
    DavidE, Jan 6, 2016
    #4
  5. If you run it with standard privileges it should display a console window and you should be able to see any error messages.
     
    cyberrufus, Jan 6, 2016
    #5
  6. I solved the problem by disabling the feature "run whether the user is logged on or not." With that disabled the batch script runs as it should and the output is visible in the command shell.
     
    SeanFilidis, Apr 4, 2018
    #6
Thema:

Task Scheduler and Bat File Problem

Loading...
  1. Task Scheduler and Bat File Problem - Similar Threads - Task Scheduler Bat

  2. Task Scheduler Problem

    in Windows 10 Gaming
    Task Scheduler Problem: While using Task Scheduling and creating a basic task, when on the screen to select the start time of the task, I cannot select a day in the future. It only let me choose today....
  3. Windows Task Scheduler - Running a .BAT File whether user is logged on or not

    in Windows 10 Gaming
    Windows Task Scheduler - Running a .BAT File whether user is logged on or not: Hi,I am using Windows 10 Pro. I created a simple .BAT file with the following location and filename:C:\PK_Temp\test.batCurrently, my test.bat file consists of just the following two commands ...Echo "Hi Paul" pause... When I run this .BAT file manually, the Windows Command...
  4. Windows Task Scheduler - Running a .BAT File whether user is logged on or not

    in Windows 10 Software and Apps
    Windows Task Scheduler - Running a .BAT File whether user is logged on or not: Hi,I am using Windows 10 Pro. I created a simple .BAT file with the following location and filename:C:\PK_Temp\test.batCurrently, my test.bat file consists of just the following two commands ...Echo "Hi Paul" pause... When I run this .BAT file manually, the Windows Command...
  5. Windows Task Scheduler - Running a .BAT File whether user is logged on or not

    in Windows 10 Customization
    Windows Task Scheduler - Running a .BAT File whether user is logged on or not: Hi,I am using Windows 10 Pro. I created a simple .BAT file with the following location and filename:C:\PK_Temp\test.batCurrently, my test.bat file consists of just the following two commands ...Echo "Hi Paul" pause... When I run this .BAT file manually, the Windows Command...
  6. Task scheduler problem

    in Windows 10 Installation and Upgrade
    Task scheduler problem: I upgraded my system from Windows 7 to Windows 10 and encountered an issue with Task scheduler. When I run a command "winver.exe", it doesn’t work with "Run whether user is logged on or not" and "Run with highest privileges". It works only with "Run only when user is logged...
  7. Scheduled Task Won't Launch Program with .bat File

    in Windows 10 Customization
    Scheduled Task Won't Launch Program with .bat File: I wrote a couple simple bat files to both shut down and launch Adobe Media Encoder on a Windows 10 machine. When I double click on them, both launch and execute flawlessly. However when I schedule a task and click to run them from the scheduled task, the status just shows...
  8. Start VM via bat file in Windows Task Scheduler

    in Windows 10 Virtualization
    Start VM via bat file in Windows Task Scheduler: I'm attempting to start a VM from a bat file with Windows 10 Task Scheduler. The bat by itself and the script via CMD execute correctly, though I cannot get it to run as a bat in Task Scheduler. I've tried different configurations, directly from a CMD, etc. Interesting...
  9. bat job started by Task Scheduler does not pause

    in Windows 10 Support
    bat job started by Task Scheduler does not pause: In the last week or so all bat jobs started by Task Scheduler have not paused. Previously, I would find a black CMD window open, waiting for me to hit return to close the window. The following test indicates that the bat job ran, but it did not pause. TEST.BAT time /T >...
  10. Cannot run BAT file with Task Scheduler "Access Denied".

    in Windows 10 Support
    Cannot run BAT file with Task Scheduler "Access Denied".: Hi all. I am learning some basic batch scripting and I've created a file with the following code: [img] All this does is move various file types to various folders to clean up my desktop. If I click on the .bat file directly it works great. But if I try to run it...

Users found this page by searching for:

  1. cant run bat file in windows 2016 task scheduler