1.

Solve : all,Task Scheduler?

Answer»

Hi all,

How can I create a batch file that would restart the COMPUTER that is scheduled but the timer would restart whenever the user opens a certain file like notepad. So the counter would be like scheduled an hour from now and then when the user opens notepad, the timer would restart to add ANOTHER hour before it restarts. If you are wondering why... I SOMETIMES sleep in front of my computer. Imagine how sticky my keyboard is! Also, this batch file is active, somewhat looping and never ending... I don't want to USE resource kits.

I'm starting at this command:

tasklist | find /i "notepad.exe"
if errorlevel 1 *the batch file that would schedule the restart
tasklist | find /i "iexplorer.exe"
if errorlevel 1 * the scheduled timer would reset and the new restart sched

If there is another way, that would be great!


ECHO
Check out the AT command for adding and deleting jobs from the task scheduler. For the restart you can use the SHUTDOWN command with the proper switches.

Questions:

1) Why don't you want to use the resource kits? There is a lot of functionality in them and they are free to download and use.

2) Should it not be if not errorlevel 1?

Just a thought. 8-)



Discussion

No Comment Found