How To Use A Batch File To Launch Programs

Posted: 01/02/2012 in All Teched UP!, education, General, How to....
Tags: , , ,

I have had a mail from Darren Jacobs with the question:

‘Hi Caintech,

  I have a PC that I only use to browse the web and read emails with, I use Thunderbird for my email and Firefox for the web. What I am trying to do is have these programs open and start automatically when Windows starts, I am using Windows 7.

  Can you help please?’

So here goes:

If you need to start a program or a group of programs automatically, but don’t want the hassle of clicking on them, why not create a batch file to do it for you?

Before you start press Start (Windows start menu) and type ‘Folder Options’ and select the first option at appears. In this new window select the tab ‘View’ and untick the option ‘Hide extensions for know file types’

Press ‘OK’ to make the change and close the window. You will now be able to see the file extensions of files.

So lets make a batch file:

Launch Notepad and type the following (Note: you can replace the program names with whatever program you want to launch). See Image:

As you can see by the image. We’ve got the words @echo off which instructs the batch file not to show results in the command window. Then we’ve got the words Start followed by a space and followed by the name of a program. In this case we are launching Firefox and Thunderbird.

  9 times out of 10 this method will work fine. On occasion you may need to type out the full path to the program.

For example

As you can see by this example. I’ve found the directory where the program is located and enclosed it in double quotations preceded by 2 double quotes.  I’ve also enclosed the application_name.exe at the end.

Now save this text document and rename it ‘Startup.bat’. Now you have changed the file type from a text file to a batch file (you’ll will get a warning when you change the file extension but you can ignore this) You can now test this file by right clicking on it and select ‘Run’

If everything opens up fine you can you can now drop this file into you ‘Start Up’ folder

C:\Users\ Your user name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Now restart and watch the magic happen.

For more help with Batch files and Dos have a look at www.computerhope.com/batch.htm

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s