124
votes
Accepted
How to monitor a folder and trigger a command-line action when a file is created or edited?
At work we use Powershell to monitor folders.
It can be used since Windows Vista (.NET and PowerShell is preinstalled) without any additional tools.
This script monitors a certain folder and writes a ...
66
votes
Accepted
Schedule a task with admin privileges without a user prompt in windows 7
Open Task Scheduler
Create a new task
In the "General" tab - ensure the following settings are entered:
"Run whether user is logged on or not"
"Run with highest privileges"
"Configure For" (your ...
37
votes
Accepted
How can I copy a scheduled task from a dead Windows to new Windows
There are two directories within which you might find a scheduled task definition or log:
c:\windows\tasks
c:\windows\system32\tasks
That said, depending on the task, you may or may not have ...
24
votes
Using Task Scheduler to Run a Task Before Shutdown
Even though this is an older thread, I'd like to add a solution I devised that works well.
I wanted to run a script or batch file whenever a shutdown or restart was initiated, but I didn't want to ...
22
votes
Accepted
Starting scheduled task by detecting connection of USB device
The thread Task Scheduler: How to automatically synchronize my USB flash drive?
has this answer by a user called monotone, which uses PowerShell together with
the Task Scheduler :
I had the same ...
19
votes
How can I copy a scheduled task from a dead Windows to new Windows
Tasks are normally stored in C:\Windows\System32\Tasks (as xml files).
You should be able to import from there
18
votes
Accepted
Windows 7 Task Scheduler is giving me an error saying "The specified account name is not valid"?
The issue was after changing my PC name, tasks I had created in Task Manager still had the User in Security Options set to the old PC name. The way to fix this was for every task:
Task Manager > ...
13
votes
Accepted
Windows 10: Scheduled tasks with workstation lock/unlock not being triggered
Follow the below steps to troubleshoot and resolve your problem
Task Scheduler Properties. . .
From Windows Task Scheduler on the job properties (see bottom most screen shots) in the. . .
1. ...
13
votes
Accepted
How to fix broken permissions for Windows scheduled task?
All tasks definitions stored in both
Registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\*
and
Filesystem: C:\Windows\System32\Tasks\*
Security ...
12
votes
Accepted
How to stop Windows 10 from autostarting apps?
Go to Start then Settings, select Privacy and click on Background apps. From there disable the apps that you don't want running in the background.
These apps don't start with Windows, that's why they ...
10
votes
Accepted
Search Task Scheduler Library
Is there any way to create a filter on Task Scheduler's library pane
I don't think it is possible to create a filter in Task Scheduler.
However, you can use explorer's search facilities to do the ...
10
votes
Accepted
'at' command intended behaviour? Launching each commands instead of scheduling
at reads commands from standard input. What you are doing is running ./tests.o and feeding its output string(s) as command(s) for at to schedule. Also, there is no need for the trailing &, as at ...
9
votes
Accepted
Powershell script to list scheduled tasks on remote systems
I finally wrote a script that suits my needs. This script will 'scan' all the servers listed in AD, searching in the c:\Windows\System32\tasks folder for xml files. Then it will write the value of the ...
8
votes
How to pass an argument to a Windows Scheduled Task with spaces in it
schtasks.exe /create /SC WEEKLY /D SUN /SD 11/12/2015 /ST 12:00:00 /TN "taskname" /TR "'c:\program files(x86)\task.exe' Arguments"
Note the use of ' in the path of a file to be run.
8
votes
Trigger Task Scheduler in Windows 7 when computer wakes up from sleep/hibernate
Event 107 when resumed from sleep, and 42 from entering to sleep.
I just try event 107 to trigger a program when resume from sleep, and it worked
8
votes
Accepted
Slurm jobs are pending, but resources are available
SLURM by default does not allow resources sharing, so when a job runs in 1 node the rest of the jobs wait for it to complete before executing any further jobs on the same node.
SLURM needs to be ...
8
votes
Multiple odd accounts in Windows 10 Task Scheduler
You won't be able to provide any password there as the user S-1-5-18 is a system account. The PSExec tool from SysInternals can work around this issue by launching Task Scheduler as SYSTEM. Run this ...
7
votes
Task Scheduler won't wake the computer
If you are putting your computer to sleep with the commonly used batch script command Rundll32.exe Powrprof.dll,SetSuspendState Sleep then the scheduled task will not be able to wake the computer from ...
7
votes
Accepted
How to disable a windows schedule task in Windows 10 using the utility schtasks?
Use Powershell!
Disable-ScheduledTask -TaskName "Adobe Flash Player Update"
TaskPath TaskName State
-------- ...
7
votes
Use Windows Task Scheduler To Put Windows To Sleep Without Batch File
Set up your time in Task Scheduler's Triggers window as normal. On the General tab, it's probably easiest to make the task run as SYSTEM, and run whether the user is logged in or not. Highest ...
6
votes
Powershell script to list scheduled tasks on remote systems
Hey thought I'd share a modified version of the script posted by Ob1lan. The modification helps find tasks in nested folders and lists the status of the task as well as details included in the ...
6
votes
Windows 10: Scheduled tasks with workstation lock/unlock not being triggered
I solved this by bypassing the "On Workstation Lock/Unlock" trigger types, and setting triggers to look at the windows event log directly.
It's not ideal, but should be sustainable. Definitely still ...
6
votes
Accepted
Updating a scheduled task with 'repeat every x hours' causes it to be triggered on Windows 10
Prevent a Task Scheduler Task from Executing on Setting Updates
Set the Edit Trigger to run at an interval of One Time and then in Advanced settings section, select Repeat task every 4 hour with for ...
5
votes
How to monitor a folder and trigger a command-line action when a file is created or edited?
If the action is just to copy changed files, you can use robocopy /MON:1
I don't know if robocopy uses FileSystemWatcher or works by polling for changes.
5
votes
Windows Task Scheduler: Schedule task to run once every 10 seconds
It's silly windows doesn't have this functionality built into Task Scheduler. However, it can be easily worked around with a simple powershell script.
$i = 0
for ($i=0; $i -le 4)
Start-Service -...
5
votes
Simple Linux-based task scheduler with job dependencies?
These look interesting:
https://airflow.incubator.apache.org/
not so simple but powerful and supported by apache, configured by code, widely used now
https://www.digdag.io/
java airflow like, ...
5
votes
Creating Task With a Batch File - run task as soon as possible if missed
Powershell to rescue, use -StartWhenAvailable
Set-ScheduledTask `
-TaskName $TaskName `
-TaskPath $TaskPath `
-Trigger $(New-ScheduledTaskTrigger -At "01.01.2018 05:00:00" -DaysOfWeek $...
5
votes
Windows scheduler that runs every x minutes daily on the command line
Is there a way to schedule a task that runs every 5 minutes daily?
You can do this with the following command:
schtasks /create /tn "MyTask" /sc minute /mo 5 /tr "MyTask.cmd"
Explanation:
/...
5
votes
Accepted
Hyper-Threading (SMT) Affinity and Equality
Are both threads on a physical CPU treated equally?
Yes. There is no preference in allocation of the core's execution resources to one thread or the other. (What's an "execution resource"? See the ...
5
votes
How to run very long ansible tasks?
For a long running task use Ansible's Asynchronous mode to effectively background the task.
- name: 'YUM - fire and forget task'
yum: name=docker-io state=installed
async: 1000
poll: 0
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
scheduled-tasks × 908windows × 318
windows-7 × 155
windows-10 × 140
task-scheduler × 103
windows-task-scheduler × 92
powershell × 82
batch × 62
command-line × 60
windows-xp × 45
batch-file × 43
sleep × 32
linux × 31
windows-8 × 30
script × 28
cron × 25
macos × 21
backup × 21
tasks × 18
automation × 16
windows-server-2008-r2 × 16
windows-server-2012 × 16
boot × 15
cmd.exe × 15
permissions × 14