Solved

Launching an application at Windows 7 startup

Posted on 2011-03-03
14
326 Views
Last Modified: 2012-06-22
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?

0
Comment
Question by:gbmcneil
14 Comments
 
LVL 38

Expert Comment

by:Aaron Tomosky
ID: 35031519
Put a shortcut in the all programs startup folder
0
 
LVL 1

Expert Comment

by:WBGames
ID: 35031524
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 ?

0
 
LVL 9

Expert Comment

by:Misbah
ID: 35031545
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
0
 

Author Comment

by:gbmcneil
ID: 35031616
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.

0
 

Author Comment

by:gbmcneil
ID: 35031835
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?
0
 
LVL 9

Accepted Solution

by:
Misbah earned 125 total points
ID: 35031948
assume your program is located in c:\windows\myprogram.exe

create new text file (batch file) that contains:
----------------
sleep 120
c:\windows\myprogram.exe
----------------

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.

0
 
LVL 9

Expert Comment

by:Misbah
ID: 35031969
to wait for 7 hours, use:
sleep 7h
0
Do email signature updates give you a headache?

Constantly trying to correctly format email signatures? Spending all of your time at every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

 

Author Comment

by:gbmcneil
ID: 35033392
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




0
 

Author Comment

by:gbmcneil
ID: 35033394
By the way I am running Windows 7 on a 64-bit laptop computer.
0
 
LVL 9

Expert Comment

by:Misbah
ID: 35033515
0
 

Author Comment

by:gbmcneil
ID: 35037976
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
0
 
LVL 9

Expert Comment

by:Misbah
ID: 35038316
use the full path to execute the sleep.exe program.
example:
c:\downloads\sleep.exe 120
0
 

Author Comment

by:gbmcneil
ID: 35040379
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

0
 

Author Closing Comment

by:gbmcneil
ID: 35122290
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).
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now