Run your application on Startup
Use this board to post your code snippets - tips and tricks
Hello,
This maybe useful to some of you just incase you want to run your application when the system boots up.
It adds/removes and entry from the registry so please be careful.
To add your application to startup:
I dont know why I use the word Jimbob alot lol, I must have watched too many episodes of the Waltons when I was growing up :lol:
Happy coding cooll;
This maybe useful to some of you just incase you want to run your application when the system boots up.
It adds/removes and entry from the registry so please be careful.
To add your application to startup:
Code: Select all
To remove your application from startup:Dim AddToStartup As Microsoft.Win32.RegistryKey
AddToStartup = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
AddToStartup.SetValue("Jimbob", Application.ExecutablePath)
AddToStartup.Close()
Code: Select all
In both codes you will see the word "Jimbob", replace this word with a unique identifier for your application. It can be anything you like its just a name for your application. Make sure you use the same identifier when adding/removing from the registry.Dim AddToStartup As Microsoft.Win32.RegistryKey
AddToStartup = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
AddToStartup.DeleteValue("Jimbob")
AddToStartup.Close()
I dont know why I use the word Jimbob alot lol, I must have watched too many episodes of the Waltons when I was growing up :lol:
Happy coding cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
works this with 64x bit because i wanna make a program for a friend and he has 64x bit
i dont see why it shouldn't work
Nice little tip codenstuff, I will have to try this out
Many Thanks
Chris
Many Thanks
Chris
thanks
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that
Couldn't you modify this to copy the program to the Startup folder and it would be easier? I'm not sure but could you?
I was looking for something like this, but is it, cause of the registry that makes it startup when logged in, or what???
think its for current uer
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that
Nice Tutorial Codenstuff.
I have used this very same code as an option in many of my projects.
It works very well, And I have found to be safe to use.
Because I use SpyBot to protect all my registry information, SpyBot
or other registry watcher software will be alerted on any chance made to the registry.
(This is a good thing)
I have tested it on XP sp1,2 and 3 Vista(All Versions) and I have had no problems using this code.
Scottie1972
I have used this very same code as an option in many of my projects.
It works very well, And I have found to be safe to use.
Because I use SpyBot to protect all my registry information, SpyBot
or other registry watcher software will be alerted on any chance made to the registry.
(This is a good thing)
I have tested it on XP sp1,2 and 3 Vista(All Versions) and I have had no problems using this code.
Scottie1972
Copyright Information
Copyright © Codenstuff.com 2020 - 2023