C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 06-17-2009, 12:54 PM   #1
Registered User
 
Join Date: Jan 2009
Posts: 81
Making a program run on startup

I have a program that I wish to make windows run it as soon as windows starts up. How would I do this? Would it involve messing with the registry? If so, how would I do it?
Poincare is offline   Reply With Quote
Old 06-17-2009, 01:04 PM   #2
Registered User
 
hk_mp5kpdw's Avatar
 
Join Date: Jan 2002
Location: Northern Virginia/Washington DC Metropolitan Area
Posts: 2,787
Copy it (a shortcut) to the startup folder. Or... add it as a scheduled task to be run on startup.
__________________
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
--Charles Babbage, 1792-1871

09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
hk_mp5kpdw is offline   Reply With Quote
Old 06-17-2009, 02:33 PM   #3
Registered User
 
Join Date: Jan 2009
Posts: 81
See, I want I my program to do this automatically, without the user having to do anything. I'm sure you can do this because I've seen loads of programs that run once windows starts.
Poincare is offline   Reply With Quote
Old 06-17-2009, 02:37 PM   #4
+++ OK NO CARRIER
 
quzah's Avatar
 
Join Date: Oct 2001
Posts: 10,258
Well, since that's more of a Windows issue, you'd be better searching a Windows specific forum. Or, you know, just throwing a collection of seemingly random words at a search engine. Might I suggest the following, completely unrelated words:

"windows programming C run at startup"

I wrote a very complex random word generator, and that was the first thing that it gave me. I can run it again and give you more completely unrelated words if you need them. Honestly though, I'd just as soon not.

Quzah.
__________________
Hundreds of thousands of dipshits can't be wrong.


Are you up for the suck?
quzah is offline   Reply With Quote
Old 06-17-2009, 05:52 PM   #5
Registered User
 
Join Date: Sep 2006
Posts: 2,502
Quote:
Originally Posted by Poincare View Post
See, I want I my program to do this automatically, without the user having to do anything. I'm sure you can do this because I've seen loads of programs that run once windows starts.
You've been given the EXACT answer here:

Quote:
Copy it (a shortcut) to the startup folder. Or... add it as a scheduled task to be run on startup.
Do you need to get it tattooed to your forehead or what?

Right click on the program executable, and select "create a shortcut". Then drag that shortcut to the user's startup menu that you want:
Documents and Settings\all users\Applications Data (AppData for Vista and Win7)\Start Up, iirc.

And quit acting like you haven't been given the correct answer already.

Cheers.
Adak is offline   Reply With Quote
Old 06-17-2009, 06:08 PM   #6
Banned
 
ಠ_ಠ's Avatar
 
Join Date: Mar 2009
Posts: 533
Quote:
Originally Posted by Adak View Post
You've been given the EXACT answer here:



Do you need to get it tattooed to your forehead or what?

Right click on the program executable, and select "create a shortcut". Then drag that shortcut to the user's startup menu that you want:
Documents and Settings\all users\Applications Data (AppData for Vista and Win7)\Start Up, iirc.

And quit acting like you haven't been given the correct answer already.

Cheers.
I think you missed the "without the user doing anything" part
__________________
╔╗╔══╦╗
║║║╔╗║║
║╚╣╚╝║╚╗
╚═╩══╩═╝
ಠ_ಠ is offline   Reply With Quote
Old 06-17-2009, 07:12 PM   #7
Registered User
 
Join Date: Sep 2006
Posts: 2,502
Are you asserting that the start up folder won't start the programs which have shortcuts to them, inside that folder?

The user doesn't have to do *anything* - even sign in, depending on which start up folder you choose.
Adak is offline   Reply With Quote
Old 06-17-2009, 07:35 PM   #8
Registered User
 
Join Date: Dec 2008
Posts: 99
Quote:
Originally Posted by hk_mp5kpdw View Post
Copy it (a shortcut) to the startup folder. Or... add it as a scheduled task to be run on startup.
I'm sure his question was targeted at being more detailed in your latter option; adding it as a scheduled task to be run on startup.
abraham2119 is offline   Reply With Quote
Old 06-17-2009, 07:43 PM   #9
and the hat of sweating
 
Join Date: Aug 2007
Location: Toronto, ON
Posts: 3,119
I believe he means he wants his program to add something to be started automatically, not doing it by hand.
Having your program copy it to the startup folder would probably be the easiest way, but the location of the Startup folder changes with almost every version of Windows, so you'd need to find out which version of Windows you're on before you can know where to copy it...

Using the registry might be better, but you'll have to read about the Registry API functions. Here's the location to add the program to:
Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
__________________
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
cpjust is offline   Reply With Quote
Old 06-21-2009, 12:45 PM   #10
Registered User
 
Join Date: Jan 2009
Posts: 81
thanks a lot.
Poincare is offline   Reply With Quote
Old 06-21-2009, 12:50 PM   #11
Mysterious C++ User
 
Join Date: Oct 2007
Posts: 14,099
Adding it to HKEY_LOCAL_MACHINE makes it start up for every user on the machine (and requires admin privileges).
You can also add it to:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Curre ntVersion\Run
Which makes it start for the current user, only. This does not require admin privileges.
__________________
Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System
I dedicated my life to helping others. This is only a small sample of what they said:
"Thanks Elysia. You're a programming master! How the hell do you know every thing?"
Quoted... at least once.
Quote:
Originally Posted by cpjust
If C++ is 2 steps forward from C, then I'd say Java is 1 step forward and 2 steps back.
Elysia is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to time how long a program takes to run? advancedk C Programming 2 08-18-2008 07:50 PM
Get program to copy itself into program files, then start on startup. guitarist809 Windows Programming 6 03-03-2008 09:42 AM
Need help getting a program to run command prompt and a windows app together Crazy Glue C# Programming 2 12-22-2006 08:45 PM
What's the code for a program to run in Task manager, under the processes tab newbie1 Windows Programming 5 04-17-2003 07:07 AM
help making a program run Dummies102 C++ Programming 3 02-22-2002 12:51 PM


All times are GMT -6. The time now is 07:20 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22