Solved

program runs every time computer starts

Posted on 2000-04-18
5
159 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

708 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

13 Experts available now in Live!

Get 1:1 Help Now