Windows Startup

How do I make my program open when windows starts up without putting a link in the startup folder in the startup menu?  I think you have to register the program with windows or something like that.  If you do need to register the program, how would I make it register itself automaticaly?
mrcool4444Asked:
Who is Participating?
 
Jaysin28Connect With a Mentor Commented:
You could put your program.exe in the Load= section of the win ini file.  
0
 
mrcool4444Author Commented:
How would I have it do that automaticaly?
0
 
Jaysin28Commented:
In the setup program you would have to include a function to open the Windows INI file and add Myapp.exe to the load= statement in the General section of the ini file.  

You should note however that if your planning for your app to be Windows 2000 logo compliant then you can't make any references to INI files because says that in future versions of Windows these files may not exist.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
mrcool4444Author Commented:
The only thing is I don't want to use a setup program, and how would I have it open the win.ini file and add it to it?
0
 
Jaysin28Commented:
LoadStr = GetSetting("General","Load","","Win.ini")
LoadStr = Loadstr & "; " & app.EXEName
SaveSetting ("Win.ini", "General", "Load", LoadStr)
0
 
mrcool4444Author Commented:
Were would I add this to in the code, the General Declorations?  And were it says name, that is were I put the name of my program right?
0
 
Jaysin28Commented:
no, App.exename returns the name of your program.  I would put the declarations in Form_Load.  How did you plan on installing this app?
0
 
mrcool4444Author Commented:
Going to file and compile and it creates an .exe that works fine with all computers (or atleast the ones I have tried).
0
 
mrcool4444Author Commented:
There is an error with that code and I don't know what.  Could you please revise it.
0
 
Jaysin28Commented:
It would fine on all the computers that have VBRunxxx.dll where xxx is the version of VB you compiled it with.  Have to be careful doing it that way.

AT anyrate, The only way to do without a setup prog would be to make the entries the first time the program is run.  

0
 
Jaysin28Commented:

Loadstr = GetSetting("Win.ini", "General", "Load","")
0
 
mrcool4444Author Commented:
Could you start over with the code?
0
 
VbmasterCommented:
Why not use the registry, doesn't that INI-thingie just seems like 16-bit programming?

In registry add your exe filename in

HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run/

This is a much "cleaner" way of doing it, looks more "professional".

How to add into the registry? Check out www.planet-source-code.com there's probably a couple of codes for that there.
0
All Courses

From novice to tech pro — start learning today.