How to run the program as soon as the computer is idle?

I create a new task using the "Task Scheduler" in Windows 7, which runs the program only if the computer does not work.

When creating a task, there are two criteria that I want to use:

  • "Run the task only if the computer is not working:"
  • "Wait until it is:"

However, it appears that "in Windows 7, the Task Scheduler checks that the computer is in a standby state every 15 minutes ." (can be seen here: link )

My questions:

  • How much higher are these criteria, even now, do we know that it should take at least 15 minutes? Can anyone understand the meaning of all this?

  • How can I create my task to run AS SOON AS COMPLETER ISLELE?

+6
source share
2 answers

I know this question is old, but it is aimed at someone else that could be of benefit.

I found a pretty good answer to the first question: https://superuser.com/questions/777488/task-scheduler-what-is-wait-for-idle-for

Although I still do not quite understand this, and so far I have not been able to ensure that "Start in standby mode" actually works. It appears to be intended for use in conjunction with another urgent condition.

Like you, I wanted to start the program at the moment when the splash screen started or stopped (I assume that you mean by holiday), and this is the only way I have found it so far, although it is a bit of a hack: you You can replace the screensaver executable with your own .exe (or .scr), which launches your command and then launches the actual splash screen (or runs your command when it finishes).

The path to the current exe screen is under: HKEY_CURRENT_USER \ Control Panel \ Desktop \ SCRNSAVE.EXE

You can create a batch file, for example:

start "" C:\MyStartProgram.exe C:\Windows\system32\PhotoScreensaver.scr /s C:\MyEndProgram.exe 

If you do not start the screen saver, it will be blocked until you interrupt it, and then run the final program. And / s - this means that it will launch a screensaver, and not open its configuration dialog (which, I think, is also / c).

Then convert this batch to .exe using a batch processing tool like this , which works and seems clean. Then rename the .exe extension to .scr and set it as the SCRNSAVE.EXE registry key that I said above (which, remember, will get reset whenever you change any ss settings in the control panel).

Hope someone helps.

+3
source

Starting with Win XP Pro, the procedure is as follows. Performing a scheduled task when the computer is in standby mode 1. Open scheduled tasks. 2. Right-click the task that you want to start when the computer is in standby mode, and click Properties. 3. On the Settings tab, in the Standby time mode, select Only run task if the computer is at least inactive. 4. Enter the time (in minutes) that the computer must be idle before the task starts. The note β€’
To open the "Scheduled Tasks", click "Start", select "All Programs", "Accessories", "Office" and "Scheduled Tasks". β€’
The computer does not work when there is no mouse or keyboard activity. β€’
You can specify the time (in minutes) during which the computer tries to find the idle time to run the scheduled task. β€’
You can also specify that any task should be stopped if the computer is in use by selecting "Stop task" if the computer is no longer free.

Since the number of sensors present in modern systems is updated in Win 7. You can assign any sensor that you like as long as it is known to Win 7. At http://msdn.microsoft.com/en-us/library/windows/desktop /aa383561(v=vs.85).aspx there is a discussion of the downtime conditions of the task. Now it is a science. Great address gaphics. Your posed problem.

To start the Task Scheduler, open the Start menu, enter "task scheduler" and click "Return". A window appears with all the scheduled tasks you have listed. Expand the task scheduler library on the left to view tasks in other categories. Learn what they do.

To create your personal task, click "Create task" in the right pane of the window. Give it some name, description and add some security options. Other tabs help you create the task yourself:

The Triggers tab allows you to specify when the task will be executed. It can be synchronized, scheduled, assigned to events, perhaps every time your computer boots up, or something even more complicated.

The tab "Actions" is the place where the task will be set. This can be launching an application, displaying a message, sending an email, or executing a command line command. In the "Conditions" section, you can set specific exceptions for the task. For example, you can set it to start only if the computer has been idle for a certain time, set it to wake your computer from sleep, etc. This is especially practical, so study these options carefully. On the Settings tab, you can choose what happens if your task fails or takes too long. You can run it a second time, if it missed, otr stop the task if it works for too long, or run several instances of tasks at once. You can also choose File> Create Basic Task if you want a simpler wizard to guide you through this process.

-2
source

Source: https://habr.com/ru/post/946108/


All Articles