Windows 10: Actions in Task Scheduler

Discus and support Actions in Task Scheduler in Windows 10 Support to solve the problem; I have two Scheduled tasks whose actions start the same program, but with different parameters. If these two program instances happen to get scheduled... Discussion in 'Windows 10 Support' started by Swifty, Feb 18, 2017.

  1. Swifty Win User

    Actions in Task Scheduler


    I have two Scheduled tasks whose actions start the same program, but with different parameters. If these two program instances happen to get scheduled at more or less the same time, then one will wait for the other to finish.

    But it seems to me that sometimes the one which should start second fails to start at all. There is nothing in my code which stops the programs overlapping, apart from their own semaphore mechanism.

    Is there anything in the Task Scheduler itself that would prevent the second task triggering?

    The tasks are triggered by the events "Workstation lock" and "Workstation unlock"; the scheduled task runs a program which turns the display off and on. So, the effect is that the screen always blanks when the desktop locks, and it comes back on when the desktop unlocks.
    Sometimes, the events happen so close to each other than the "display on" and "display off" programs might try to run almost simultaneously, hence my semaphore arrangement,

    :)
     
    Swifty, Feb 18, 2017
    #1

  2. random process called svdhelper.exe opens cmd console and close automatically

    I just disable it in task scheduler

    Task Scheduler Library->Security-> click on "PPDT_CACHER_CHECKER"->at Action,click disable

    However, I dont know consequences doing it.

    But the problem solve
     
    FirdausYusoff, Feb 18, 2017
    #2
  3. How to "translate" a CMD scheduled task into a Powershell scheduled task?

    I have a scheduled Task where an Admin Command Prompt opens up and runs SFC and DISM. Here are the actions I entered in the "Action" tab of Task Scheduler:

    Program/script: %windir%\system32\cmd.exe

    Add Arguments (optional) /k Dism.exe /online /Cleanup-Image /StartComponentCleanup&&sfc/scannow&&Dism /Online /Cleanup-Image /RestoreHealth&&sfc/scannow

    I tried to run exactly the same scheduled task now on Powershell but with no luck. What do I need to do to "translate" this from CMD into Powershell in the Task Scheduler?

    Any suggestions greatly appreciated.
     
    ✨Fancy Rat✨, Feb 18, 2017
    #3
  4. Actions in Task Scheduler

    Never had occasion to review Scheduler Events myself but try event logs to see if they're helpful in seeing what's up.

    Open Task Scheduler. In right pane click Enable All Task History.

    After tasks run, right click the task->Properties and click History tab. (events are listed in reverse time order)


    You can also see all events for all tasks in Event Viewer. Click Applications and Services->Microsoft->Windows->TaskScheduler
     
    ComputerGeek, Feb 18, 2017
    #4
  5. Swifty Win User
    OK, I'll give the Event Viewer a go. Because the events include the desktop locking, and the display powering off, it gets a bit tricky trying to see what's going on. Even the event viewer might be difficult... by the time I've got the desktop to unlock and the display to come out of power saving mode, the events of interest may be some way back in the log.
    Time for bed for me now. Back tomorrow.
     
    Swifty, Feb 18, 2017
    #5
  6. lx07 Win User
    What do you mean semaphore mechanism? Do you mean some .Net thing that is "not tidy or clearly defined" Source

    Why not try to allocate an object (get an exclusive lock some temporary text file or something) and just wait until you can? Then neither program can interfere with the other.

    I'm not much of a Windows programmer - I would use ALCOBJ if it existed but something like this perhaps?

    windows - How to get an exclusive lock on a file using batch file? - Stack Overflow
     
  7. yea, logs won't tell you the detail of what's happening within the task but can answer which tasks run in which order and whether answer your question if the 2nd task runs. Might help provide some debug clues
     
    ComputerGeek, Feb 18, 2017
    #7
  8. Swifty Win User

    Actions in Task Scheduler

    That's exactly what I'm doing. The scripting language that I use reads the source code, then closes the file. So the program itself is the file that I use for my semaphore. I just get an exclusive read lock on the program, and I'm away.
    However, some of the scheduled tasks seem not to be running. I get an audible signal that the task should be running, but there's no record in the trace log generated by my program which is the action of the scheduled task.
    The first act of my program is to create a "started" trace entry, and it's these records which are not always appearing.
    If any error occurs in the tracing, the program immediately pauses and waits for me to investigate. This has never happened.

    So, tearing my hear out, I started wondering if there were some locking mechanism in the task scheduler, preventing two tasks colliding when their action is the same program.
    I'm shooting in the dark here...

    For completeness: I have a proximity device that locks and unlocks my desktop depending on where I am. As I approach the PC, I hear the Windows notification sound for the unlock event. This should trigger my "desktop unlocked" scheduled task, but this sometimes doesn't happen. This leaves me with a black screen, which hinders the debugging.
    I'm trying to get the proximity device manufacturer to trace the code around the unlock process, to see if that is failing. But if so, why am I hearing the unlock sound?
     
    Swifty, Apr 5, 2018
    #8
Thema:

Actions in Task Scheduler

Loading...
  1. Actions in Task Scheduler - Similar Threads - Actions Task Scheduler

  2. Task Scheduler: Several Start a program actions

    in Windows 10 Support
    Task Scheduler: Several Start a program actions: Hi there, I use a scheduled task to start a backup with beyond compare, but I need ondrive to start first. So I have two Actions in one schedule: Start a program C:\... ondrive.exe Start a program C:\... BCompare.exe Does the second action for Beyond Compare waits till the...
  3. Can Task Scheduler trigger upon Action Center notifications?

    in Windows 10 Software and Apps
    Can Task Scheduler trigger upon Action Center notifications?: Hello! Is it possible to set up Task Scheduler to run a command when the Action Center gets a new notification? Thanks! 152126
  4. Can Task Scheduler detect Action Center notifications?

    in Windows 10 Software and Apps
    Can Task Scheduler detect Action Center notifications?: Hello! I'm new to Task Scheduler and have a question: Some apps, while closed, can be opened in the background. One that I use sends notifications via the Action Center whenever I receive a text message. But due to an error, the notifcations disappear not long afterward. Is...
  5. Task Scheduler

    in Windows 10 Support
    Task Scheduler: I have a relatively new install of Windows 10. I installed a new SSD and installed from scratch and then reinstalled all my software. I created some scheduled tasks, just 4 simple copy and paste tasks that I use for backing up. I've recently had to reinstall from scratch my...
  6. task scheduler: wrong time of action activation

    in Windows 10 Customization
    task scheduler: wrong time of action activation: task scheduler:Action with the trigger set to log in any user activates only the moment when the laptop is connected to the power source. The action activates with the highest level of authorisation. (this is my own action). program which i set as task scheduler action(.bat...
  7. How to schedule a task on action center notification trigger

    in Windows 10 Customization
    How to schedule a task on action center notification trigger: Hi, I would like to create a task in Task Scheduler on Windows 10, which is triggered if a specific notification appears in Action Center. How can I do this, or is this even possible? Thanks in advance, David...
  8. Windows Defender Task Scheduler Action Arguments

    in AntiVirus, Firewalls and System Security
    Windows Defender Task Scheduler Action Arguments: I've seen 2 ways to add the full scan argument to MpCmdRun.exe. The first is "-Scan -ScanType 2" (without the quotes). The second is "-Scan -ScheduleJob -ScanType 2" (without the quotes). I can't seem to find anything on the -ScheduleJob parameter. Can someone tell me...
  9. Action Button and Panel Missing From 'Task Scheduler'

    in Windows 10 Support
    Action Button and Panel Missing From 'Task Scheduler': Simple to state problem. My wife's machine, she has an 'action' button and 'action' panel on her 'task scheduler' window. There is no 'action' button on my 'task scheduler' window. Neither is there an 'action' panel on the right side of my 'task scheduler' window. Advise?...
  10. Task scheduler

    in Windows 10 Support
    Task scheduler: I have created a task that will run once every night 01:00 on my Windows machine. It worked OK before upgrade to Windows 10 Pro. Now it doesn't. When I try to run it manually from Task Scheduler following error occurs: Task Scheduler service is not available. Task...