[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

program runs every time computer starts

Posted on 2000-04-18
5
Medium Priority
?
169 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 120 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

650 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