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 Customization
    Task Scheduler - problem: I open today the task scheduler and this is it:After i find this What is this. A fix? https://answers.microsoft.com/en-us/windows/forum/all/task-scheduler-problem/55faf514-6fb0-42ac-a39a-d4bff8162a1a
  3. Problems with task scheduler

    in Windows 10 Ask Insider
    Problems with task scheduler: Idle Maintenance, Maintenance Configuration, Manual Maintenance & Regular Maintenance task are all corrupted & do not work in task scheduler on my windows 10, you can export these tasks to an .xml save file, if there is anyone that could send me these four .xml task files it...
  4. 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...
  5. 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...
  6. Task Scheduler Problem

    in Windows 10 Customization
    Task Scheduler Problem: So I Wanted to Update Nvidia Geforce Experience but Than it gave me an error that Task scheduler must run (never had this problem I just could update Nvidia) and now I Have Searched On The whole internet trying to find a solution for it and Nothing worked . I Did Like...
  7. 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...
  8. Problems automating a batch file with task scheduler

    in Windows 10 Support
    Problems automating a batch file with task scheduler: I want run this bat file from task scheduler @Rem %pf% expands to the right program location depending if it is x86 or x64 system @setlocal @set pf=%ProgramFiles% @if not "[%ProgramFiles(x86)%]"=="[]" set pf=%ProgramFiles(x86)% @Rem %macropath% expands to the demo...
  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