scheduled-tasks

Windows Task for restart if user not logged in

僤鯓⒐⒋嵵緔 提交于 2019-12-11 15:06:23
问题 I'm trying to create scheduled task for Windows reboot, which is executed if any user is not logged in. If user is logged in locally or over RDP, the machine should not be restarted. For unconditional restart, I have task in Task Scheduler with: Action: "Start a program", Program/script: "powershell", Add arguments: "restart-computer -force" For conditional restart I have powershell code: $ErrorActionPreference = "Continue" $userstatus = quser /server:'localhost' if(!$userstatus){ Restart

Scheduled task fails - Unspecified Error

好久不见. 提交于 2019-12-11 13:34:31
问题 I have a c# console app that uploads data to a Sitecore/UCommerce implementation. It is based on the UCommerce UConnector. When I run this from the command line it executes without a problem all data is uploaded and downloaded correctly without error. When I try to schedule this task it exits with a 0xffffff error. The task specifies a command line parameter that sets the app to read all configurable options from the App.Config I have search this error and found many suggestions which I have

Getting the `The application failed to initialize properly`/3221225794 error executing a batch file

馋奶兔 提交于 2019-12-11 12:42:04
问题 There is a scheduled task that is attached to a custom event in the EventLog , it executes the lines below: reconnect.cmd c:\windows\system32\rasphone -f "phone_book.pbk" -d "vpn_connection" net stop my_windows_service net start my_windows_service The task ususally runs normally without errors. But sometimes it returns error The application failed to initialize properly (3221225794) . The task is configured to run under system account so it is supposed to have all required permissions to run

Using C# Task Scheduler Managed Wrapper how to trap an error if task fails and send an email

…衆ロ難τιáo~ 提交于 2019-12-11 12:19:49
问题 Using following code example I created a task. The task runs and sends an email afterwards successfully. If the task fails how do I programmatically trap the failure and then sends an email: using (TaskService ts = new TaskService()) { // Create a new task definition and assign properties TaskDefinition td = ts.NewTask(); td.RegistrationInfo.Description = "Does something"; // Add a trigger that, starting tomorrow, will fire every other week on Monday // and Saturday and repeat every 10

Coldfusion neo-cron.xml has been modified - when it hasn't been

醉酒当歌 提交于 2019-12-11 11:56:34
问题 We've just upgraded from CF 9 to 9.0.1 (ColdFusion 9 Update 1). We're running on Windows Server 2008. After the upgrade we noticed on our server that we were getting a lot of these messages in server.log : "Information","scheduler-6","10/05/10","12:34:48",,"neo-cron.xml has been modified . Reloading the service coldfusion.scheduling.CronServiceImpl@c020a" "Information","scheduler-5","10/05/10","14:54:50",,"neo-cron.xml has been modified . Reloading the service coldfusion.scheduling

Use of the random function to randomise scheduled tasks

丶灬走出姿态 提交于 2019-12-11 11:21:58
问题 I am trying to use the code: import random import datetime from sched import scheduler from time import time, sleep s = scheduler(time, sleep) random.seed() def run_periodically(start, end, interval, func): event_time = start while event_time < end: s.enterabs(event_time, 0, func, ()) event_time += interval + random.random(-5, 45) s.run() getData()####### run_periodically(time()+5, time()+1000000, 10, getData) I am trying to get the scheduled time and or the scheduled interval to have some

WriteableBitmap or PNG writer memory leak?

元气小坏坏 提交于 2019-12-11 11:15:00
问题 I am building a small Windows Phone 8 app (a Christian-Orthodox calendar) which has a background agent which should update the live tile. The app will require access to the contacts in the phone so I opted out of internet access so backend tile generation is, at least now out of question. I personally would not trust an app that has access to my contacts AND to internet. Recently my scheduled agent (which generates three PNGs) started OutOfMemoryException-ing on me. Consistently. I've used

Task scheduler trigger when system boot in C#

左心房为你撑大大i 提交于 2019-12-11 11:05:33
问题 I have created a task scheduler and set its trigger time fixed e.g. daily-5:00 pm, but I want to trigger that event when system start or boot. Please help me with code if you have any example. Thanks in Advance. Code :------------------------------------------------------ public static void CreateTask() { using (TaskService task = new TaskService()) {`enter code here` TaskDefinition taskdDef = task.NewTask(); taskdDef.RegistrationInfo.Description = "Does something"; taskdDef.RegistrationInfo

How to pause/resume or change the period time of TimerTask?

强颜欢笑 提交于 2019-12-11 09:58:40
问题 my original purpose is to execute a section of code every xx TimeUnit without simply looping it and checking a flag. I do some researches and found two solution: Timer + TimerTask - Once the timer is pause, you have to re-new another one. So do the TimerTask. ScheduledThreadPoolExecutor + Runnable - The same as the previous combination. But somebody say this is a enhanced one. But it still don't provide the functions I mentioned before. Now, I'm looking for a elegant method to solove this

How to check from scheduled agent if the foreground app is running

て烟熏妆下的殇ゞ 提交于 2019-12-11 09:58:21
问题 Is it possible to check if the foreground app is running from a scheduled task? In my case, it duplicates a functionality of the app - so I could skip that part in the agent to preserve resources. Thanks 回答1: You cannot access a list of processes or anything similiar that would give you the info if your app is running. You can do smething like storing a flag to the settings when your app starts and erasing it when your app exists and check this flag in the background agent. 来源: https:/