Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Need help setting up a specific task in Task Scheduler

30 Apr 2015   #1
moundtown

Windows 7 Pro 32 bit
 
 
Need help setting up a specific task in Task Scheduler

I would think this would be an easy thing to set up but I can't get it right. All I want to do is have a program close and then restart every four hours. No matter how I configure it the scheduler always starts a second instance without closing the first one. Can someone show me how this can be done properly?


My System SpecsSystem Spec
.
30 Apr 2015   #2
iTRiP

[Genuine Custom DOS 5.0] & [Genuine Custom Windows 7 Home Premium 64Bit SP1]
 
 

My System SpecsSystem Spec
30 Apr 2015   #3
moundtown

Windows 7 Pro 32 bit
 
 

That tutorial does not explain how to do what I want to do.
My System SpecsSystem Spec
.

30 Apr 2015   #4
paul1149

Linux Lite 2.8 x64 (full-featured, fast, rock-solid)
 
 

Set up an action that taskkill's the running process.

taskkill blahblah.exe
My System SpecsSystem Spec
30 Apr 2015   #5
Tookeri

Windows 7 Pro 32
 
 

Assuming you only have one instance running with the same name, you could use this batch file. This example kills notepad.exe, then waits 2 seconds before starting notepad again:
Code:
@ECHO OFF
taskkill /IM notepad.exe
timeout /T 2
notepad
Put the code in a text file and save it with the extension .bat Then change the sch. task to run the .bat file
You need to change the two occurrences of notepad to the program you want restarted.
My System SpecsSystem Spec
30 Apr 2015   #6
moundtown

Windows 7 Pro 32 bit
 
 

Quote   Quote: Originally Posted by Tookeri View Post
Assuming you only have one instance running with the same name, you could use this batch file. This example kills notepad.exe, then waits 2 seconds before starting notepad again:
Code:
@ECHO OFF
taskkill /IM notepad.exe
timeout /T 2
notepad
Put the code in a text file and save it with the extension .bat Then change the sch. task to run the .bat file
You need to change the two occurrences of notepad to the program you want restarted.
I changed the two occurrences of notepad to the program name, saved it as a .bat file, when I run it absolutely nothing happens.
My System SpecsSystem Spec
01 May 2015   #7
DavidE

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64
 
 

Delete the @ECHO OFF statement and add a pause command as the last command in the bat file.
This will display all commands in the bat cmd window, and keep the cmd window open so you can see any error messages.

You can post a screen print of the cmd window for help with troubleshooting any errors in your bat file.
Screenshots and Files - Upload and Post in Seven Forums

You can then press enter to close the cmd window.

Here's an example of the bat file using notepad as the program to close/restart
Code:
taskkill /IM notepad.exe
timeout /T 2
notepad  
pause
My System SpecsSystem Spec
Reply

 Need help setting up a specific task in Task Scheduler




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Task Scheduler - Create Task to Display a Message Reminder
How to Display a Message Reminder in Windows with Task Scheduler This will show you how to create yourself, or another user or group, a message reminder scheduled to display for when and how often you like in Windows 7 or Vista using Task Scheduler. All users on the computer will be able to...
Tutorials
Task Scheduler : Create Shut Down PC Automatically Task
How to Create a Task that will Shut Down the PC Automatically This will show a very easy way to create a task in the Task Scheduler that will shut down the PC whenever you like. This will work for Windows 7 and Windows Vista. Let's get started! 1) In the Windows start menu search box type...
Tutorials
simple task scheduler question: changing a task name
Hello, I scheduled some tasks in the task scheduler. One of the tasks has a typo and another I would like to change its name. There doesn't seem to be a way of doing this short of resetting up the tasks from scratch and deleting the original tasks. Would anyone know how to rename tasks in the...
Performance & Maintenance
Need help creating a task scheduler task to move files over a network.
Hello everyone, I need to have a task run that will move the contents of a folder from one computer to another over my home LAN. Files get downloaded during the night on one computer and then need to be transfered to another. Usually I am doing this by hand, but then though maybe I could get...
General Discussion
Task scheduler unable to load task status/active tasks at startup.
My task manager is unable to load task status/active tasks at startup. I get the message: "The selected task "{0}" no longer exists. To see the current tasks, click Refresh." When I refresh I get the same message. I checked and found that under Microsoft the problem was in the defrag...
Performance & Maintenance
Task Scheduler failing to start task with merged network locations
I have two routers I usually connect to (work and home) and each have wireless access. That means there are essentially 4 network locations I have listed. I have merged each respective network location (wired and wireless) into their own singular network location - "Work" and "Home". I also...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 09:39.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App