Start when windows starts.

E

etam

How, by code can i set the program to be started when windows is started?
Do sth with some files like in linux or what?
 
R

Russell Wood

How, by code can i set the program to be started when windows is started?
Do sth with some files like in linux or what?

You don't do it with code, you add an entry into the Windows Registry:
(HKLM\Software\Microsoft\Run).

- Russell
 
M

Moonlit

Hi,

You could create a link in the start menu folder. That's the easiest way. I
believe another possibility is addig it to the registry (I can't remmber the
exact key bu I think it was something line 'Run' or something.

There is an com object for helping creating a link Search msdn for it.
--


Regards, Ron AF Greve

http://moonlit.xs4all.nl
 
R

Russell Wood

You don't do it with code, you add an entry into the Windows Registry:
(HKLM\Software\Microsoft\Run).

Sorry, I think it's: HKLM\Software\Microsoft\Windows\Run
 
R

Robbie Hatley

etam said:
How, by code can i set the program to be started when windows is started?
Do sth with some files like in linux or what?

This is off-topic here. Post your question in comp.os.ms-windows.programmer
and you'll get much more and better answers.

Nevertheless, I can tell you this: Yes, you can write a C++ program that sets
itself up to start running every time Windows starts. It involves using this
function:

RegSetValueEx()

to add a value to this key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Run

The name of the value should be the name of your program.
The type of the value should be REG_SZ.
The contents of the value should be the path.

Example of added value:

Name: Type: Content:
Fred's Plasma Reticulator REG_SZ C:\Program Files\Fred\Fred.exe


For further details, ask in comp.os.ms-windows.programmer.


Also read MSDN (comes with MS-VS; also on MS website).
 
R

Robbie Hatley

etam said:
Thanks, i helped me a lot! :).

Actually, there were some errors I just noticed in what I wrote
earlier.

For one thing, the name of the newsgroup I was trying to refer
you to should have been:

comp.os.ms-windows.programmer.win32

There were other errors, as well.

I was feeling bored, so I implimented your task (set program
to run at startup in Windows). And since I'm feeling guilty
about having flubbed-up my earlier advice, I'll post the
code for you in:

comp.os.ms-windows.programmer.win32

Under subject "For Etam: How to make a program run at startup.".

--
Cheers!
Robbie Hatley
Tustin, CA, USA
email: lonewolfintj at pacbell dot net
web: home dot pacbell dot net slant earnur slant
 
L

Luke Meyers

This thread has nothing whatsoever to do with the C++ language. Please
go find a more appropriate forum for your question.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top