Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / operating-systems / Windows

Automation of Startup Items in Windows Systems

5.00/5 (1 vote)
3 Oct 2011CPOL2 min read 87K  
Using a batch file to automated startup items in Windows

Everyday it takes close to 10 minutes for me to login and open my mail box and check my mails. I come to office at 8.45 am, rush to have breakfast, and by the time I come back by 9 to attend the regular onsite call that we have with our company’s onsite resources to discuss daily updates, I don’t have time to read mails.


I thought of automating the tasks of starting the computer and opening the basic necessities related to our project.
As a first step, I changed the settings of the system to start at 8 am every day. This can be done in the following way (I use Windows XP and hence the below steps are all related to Windows XP. For other Windows OSs like Vista and 7, the steps will be more or less similar):



  1. Go to Setup > Power Management Settings > Repeat alarm settings > Specify the time(8 am) > Save changes.
  2. I wrote a batch file that starts the following programs:

    1. Outlook
    2. Communicator
    3. MS Visual Studio 2008
    4. SQL Server MS
    5. SQL Profiler
    6. Textpad

  3. You can customize the batch file to start any number of programs that you want (batch programming is simple; see my example; customize it on your own).
  4. Schedule this batch file to run whenever you login into the system. This can be accomplished by scheduling the tasks.
  5. Control Panel > Scheduled Tasks > Add Scheduled Tasks > Click on Next > Select the Batch File > On ‘Perform this task’ select ‘When I Logon’ > Finish.



I tested this once. It opens all the above mentioned programs in no time. Only Visual Studio takes some time to open. PFA the batch file. Save it as .bat and then add to Scheduled Tasks.


This may seem trivial but can save time. I can sleep for an extra 15 minutes at home every morning.


PFB the batch file code.


@Echo ON 
START /MAX OUTLOOK 
START /MAX COMMUNICATOR 
START /MAX DEVENV 
START /MAX SQLWB 
START /MAX PROFILER90
START /MAX TEXTPAD
@Echo OFF

Type this in Notepad and save it as a .bat file. Use this file in the above mentioned steps.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)