Solved

Launching an application at Windows 7 startup

Posted on 2011-03-03
14
324 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

707 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

16 Experts available now in Live!

Get 1:1 Help Now