• How To?
  • Tips ‘n Tricks
  • WordPress
  • Snippets
  • Software
    • Browsers
    • Downloads
  • Web
  • Tools
    • Character Counter
    • chmod Calculator
    • Entities Encoder
    • Live HTML Editor
    • My IP
  • Contact
Twitter Facebook Google+ RSS
You are here: SumTips » How To? » Automatically Start and Close Programs at Specific Time

Automatically Start and Close Programs at Specific Time

Posted on January 21, 2013 by Renji | Short URL: http://sumtips.com/?p=8334

Task Scheduler, a built-in component of Windows operating system, can be used to create a variety of tasks for the computer to follow automatically. You can use it to launch programs or run scripts at a scheduled time without having to depend on third-party tools.

In this post I’ll show how you can use the Task Scheduler to automatically start and close programs at a certain time. And because it is a Windows feature, this should work on all versions of the OS.

Automatically Start Programs at Specific Time

You can directly schedule a single program to start up at a particular time in Task Scheduler. However, if you want to launch multiple programs, a batch file is needed. Here’s how to create and automate one.

1. Open New Document in Notepad, and add this as the first line: @echo off. Echo off basically turns off command echoing so that you don’t get any messages when running the commands in the batch file.
2. In the next line we will specify the programs to run. Add each program on a separate line:

rem Calculator
cd %windir%\system32
start calc.exe
rem Media Player
cd "C:\Program Files (x86)\K-Lite Codec Pack\Media Player Classic\"
start mpc-hc.exe

The rem command is just a comment to identify the program, CD command changes the directory, and start is, well it just starts the program.

3. After adding all the programs you want, finish the script by adding Exit at the end. Complete script should look like this:
Start.bat

Save the file as a batch file with the name start.bat.

We’re done with our script. Now, to run the script at a specific time it has to be scheduled as a task.

  1. Open Task Scheduler by entering taskschd.msc in the Run dialog.
  2. When Task Scheduler opens, create a new Task, and give it a name.
  3. In Triggers tab, configure the schedule you want the batch script to run at.
  4. start schedule

  5. In Actions tab, browse and select start.bat file.
  6. If you want, you can configure more settings in “Conditions” and “Settings” tab, but they are not necessary. Finally, click OK to save changes.

That’s it! Your program(s) should now automatically start up at your specified time.

Automatically Close Programs at Specific Time

We have to create another batch script for closing programs at the scheduled time.

Create another New Document in Notepad, and drop in a line like this in it:

TASKKILL /F /IM calc.exe
TASKKILL /F /IM mpc-hc.exe

TASKKILL is a built-in utility in Windows used to kill programs and processes. /F parameter forcefully terminates programs, and /IM is used to specify the program name.

Save the document with the name close.bat. Now, just like we did earlier, schedule this batch file as task to run at a time you want. Remember to enable one important setting while doing so – check “Run with highest privileges” in the General tab. This is to ensure programs do exit in Windows 7 and Windows 8.

That’s all.


Tweet

Related posts:

  • Selectively Run Programs without UAC Prompt on Windows 7 & 8
  • Run Program When Windows Resumes from Sleep or Hibernate
  • Batch File To Open Multiple Programs At Once
  • How To Uninstall Specific Windows Essentials Programs
  • Automatically Switch Windows Theme When on Laptop Battery
Categories: How To?, Tips 'n Tricks, Windows | Tags: Tips 'n Tricks, Windows
How to Copy Code from Notepad++ with Syntax Highlighting
Windows 8: Auto Update Defender with Windows Update Disabled

  • Get Updates via Email

  • Recent Posts

    • CMS2CMS: Migrate Site from Drupal or Joomla to WordPress
    • WordPress: Add Preview Button in Distraction Free Writing
    • How to Activate or Deactivate Individual Jetpack Modules
    • Windows 8: Auto Update Defender with Windows Update Disabled
    • Automatically Start and Close Programs at Specific Time
    • How to Copy Code from Notepad++ with Syntax Highlighting
  • Random Posts

    • Customize WordPress Admin Bar by Adding/Removing Links
    • Move Minimize, Maximize & Close Buttons to The Left in Ubuntu
    • Open Applications Menu with Windows Key on Ubuntu
    • Convert Partial Feed into Full Feed with WizardRSS
    • Funny Google Image Search with JavaScript
    • Password Protect Firefox Bookmarks with Link Password
  • Categories

    • Blogging
    • Games
    • Google
    • How To?
    • Linux
    • Microsoft
      • Windows
    • Miscellaneous
    • Phone
    • Snippets
      • AutoHotkey Snippets
      • CSS Snippets
      • htaccess Snippets
      • JavaScript Snippets
      • PowerShell Snippets
      • WordPress Snippets
    • Social
    • Software
      • Browsers
    • Tips 'n Tricks
    • Wallpapers
    • Web
© SumTips. Contact | Sitemap | Privacy Policy