Can anyone tell me the code to make a program start up with the computer? Using the registry or win.ini? thanx
Printable View
Can anyone tell me the code to make a program start up with the computer? Using the registry or win.ini? thanx
Add a shortcut to the Startup folder :rolleyes:
There are registry keys too, but I forgot which ones. Run, RunOnce etc.
.
Why dont you place your program in the windows start menu
Your exe. file
Huw
HKEY_LOCAL_MACHINE
Software
Microsoft
Windows
CurrentVersion
Run
You can place it in the HKEY_CURRENT_USER hive as this will have the same path under it & only apply to the user who installed your program as opposed to everyone on that machine.
RunOnce is used when you attempt to install a file & an existing one is in use - you can't overwrite the file so you place an entry to copy over the file in this key which'll excecute the next time windows starts. You don't want this one or the runonce, just use run or as mentioned above (which'll be easier for you) use the startup folder.
Alex would you mind telling how to to add things to the regestry?
Phew, took a little while to write this one, but this little module should cover any work relating to adding items into the windows registry... :)
Thanks a lot man
Quote:
Originally Posted by alex_read
Yeah.. and it took me a while to debug the problem as well.. Sorry I have just got to post this alex... there is a tiny teeny bit of problem here... you forgot to add the count of the null terminating character for the size of the value.
This is in CreateRegistryKeyValue
VB Code:
lngReturnKeyValueSize = Len(Trim(strTempValue)) + 1 If (RegSetValueEx(lngReturnKeyHandle, strKeyName, ByVal 0&, REG_SZ, Trim(strTempValue) & vbNullChar, lngReturnKeyValueSize) = 0) Then CreateRegistryKeyValue = True End If