Solved

program runs every time computer starts

Posted on 2000-04-18
5
163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…

749 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