Launching an application at Windows 7 startup

Hello Experts -

How do I get an application to start when my computer boots up?

Also, since I realize that there are many programs being started, howcan I direct the system that I want to be the last in line?

Who is Participating?
MisbahConnect With a Mentor Commented:
assume your program is located in c:\windows\myprogram.exe

create new text file (batch file) that contains:
sleep 120

rename the file to : myprogram.cmd,
copy this file to
C:\Users\[UserName]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

so now ..the sleep command ..will wait for 120 seconds before starting your program.

Aaron TomoskySD-WAN SimplifiedCommented:
Put a shortcut in the all programs startup folder
To make programs start when windows boot just add the program shortcuts to the startup folder under all programs .

And to put a software last in the line , for me it doesnt matter because it will launch anyways :)

Any reason you wanted to do that ?

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

put a shortcut for your program in this folder:, replace [UserName] with the username in your system.
C:\Users\[UserName]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

or if you want to start this program for all users..put the shortcut here :
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
gbmcneilAuthor Commented:
Thanks for responding. I appreciate any help you can give me.

I hope I don't sound like a dummy here, but how do I get access to the startup directory? If I try to use an editor at the DOS-level under my user name, I am not allowed to open the subdirectory. It's locked.

Also, it is significant that I'm the last in line because I've written a program to recover in the event of a power outage with the intent that a series of programs be run unattended at night. If I am not last, there may be other programs that will have to wait 7 hours or more before they are executed.

gbmcneilAuthor Commented:
Is there a way to add my program thru the GUI, or is this something usually done with an editor?

I can edit C:\Users\[UserName]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup with UltraEdit. This particular subdirectory does not lock me out.

Also, as far as the running order, it's difficult to determine "what" is being run "when". Does anyone know how to determine the order of execution?
to wait for 7 hours, use:
sleep 7h
gbmcneilAuthor Commented:
The current situation proves that there is no program too small that can't cause trouble.

I've got two problems here:

1. I get an error message when the cmd program runs. It says:

"windows\system32 > sleep 120

Sleep is not recognized as an internal program or external command, operable program or batch file."

2. The command window opens when the cmd file is executed. Can we stop this by piping the output from Sleep to null? Possibly, like this:

Sleep 120 > null

gbmcneilAuthor Commented:
By the way I am running Windows 7 on a 64-bit laptop computer.
gbmcneilAuthor Commented:
Gee Doc -

Thanks for your help. I tried to copy sleep.exe into my c:\windows\system32 subdirectory. My 64-bit computer is knowledgeable enough to know that this isn't a 64-bit app and copies the executable into c:\windows\syswow64.

Now, when I re-boot, the same type of message comes up. The command window opens and the error shown below appears. Do you think I aught to add c:\windows\syswow64 to the Path?

 Command Window at Boot Up Command Window at Boot Up
use the full path to execute the sleep.exe program.
c:\downloads\sleep.exe 120
gbmcneilAuthor Commented:
Hello Dr. Hussain -

I  embellished on your suggested cmd file by converting the code to VBScript. I did so with the hope that I could run the Sleep program in  a hidden (non-Windowed) mode.

Here is what I have in the way of code now. Everything seems perfect, except that when VBScript attempts to run Line 2 it still can't find "Sleep.exe".

If I change the scriplet so that WinShell.Run only runs "Sleep" (without the parameter "120", things are cool. But, then the scriplet won't delay for 2 minutes.

It seems like whichever way I turn, I can't find a complete solution to my problem.

Any thoughts? I didn't think that passing a parameter in VBScript was any big deal. I thought you just threw it in.

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run chr(34) & "%SystemDrive%\Windows\SysWOW64\ _ Sleep.exe 120" & Chr(34), 0, True

WshShell.Run chr(34) & "%SystemDrive%\Resources Stocks\2011 _ \Equities\Commodities\Gold\Analysis\A History Feb15\110224 _
 NA Gold History Feb15 - 0 Portfolio Report.xls" & Chr(34), 1,_ True
Set WshShell = Nothing

Open in new window

gbmcneilAuthor Commented:
Technically Dr. Hussain is correct.

However, I am still trying to be the last in line to launch at boot up, and do it without causing any activity on the display (i.e., showing the cmd window).
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.