Solved

program runs every time computer starts

Posted on 2000-04-18
5
160 Views
Last Modified: 2010-04-04
How to make that program runs every time computer starts, but not that program or its shortcut is in StartUp in StartMenu?
0
Comment
Question by:Jurica2505
5 Comments
 
LVL 2

Accepted Solution

by:
rene100 earned 30 total points
ID: 2727935
Hi

Add the location of the exe-file to
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

regards

rene
0
 
LVL 17

Expert Comment

by:inthe
ID: 2727959
hi,
you use the registry and put program under "run" key,you can do this in a setup/install program like so:

Uses Registry;

procedure RunOnStartup(
  sProgTitle,
  sCmdLine    : string;
  bRunOnce    : boolean );
var
  sKey : string;
  reg  : TRegIniFile;
begin
  if( bRunOnce )then
    sKey := 'Once'
  else
    sKey := '';

  reg := TRegIniFile.Create( '' );
  reg.RootKey := HKEY_LOCAL_MACHINE;
  reg.WriteString(
    'Software\Microsoft'
    + '\Windows\CurrentVersion\Run'
    + sKey + #0,
    sProgTitle,
    sCmdLine );
  reg.Free;
end;


Usage:
sProgTitle
Name of your program. Generally speaking, this could be anything you want.
sCmdLine
This is the full path name to your executable program.
bRunOnce
Set this to True if you want to run your program just once. If this parameter
is False, your program will be executed every time Windows startsup.
Example:

RunOnStartup( 'Title of my program', 'MyProg.exe', False );
0
 
LVL 4

Expert Comment

by:Radler
ID: 2732690
Hi Jurica,

I'm confuse with your questions
http://www1.experts-exchange.com/Computers/Programming/Windows/Delphi/Q_10322797.html
http://www1.experts-exchange.com/Computers/Programming/Windows/Delphi/Q_10326634.html

Grade it first, please. Your image at E-E can be misunderstood.

T++, Radler.
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2734096
Being Lazy, but take Barry's example......


RunOnStartup( 'Title of my program', 'MyProg.exe', False );

Replace Myprog.exe for this

RunOnStartup( 'Title of my program',paramstr(0), False );

Your program works even if its run off a network, \\whaterver\c\

Its self automatic......
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2736316
Jurica2505

Was this a delphi question? or a question out of place?.... if it was a delphi question, i think its rather unfair on inthe... if it was not, why did you post it here?...

Craig C.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

895 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