Get your program to startup when Windows starts! menu

Shout-Out

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    kikpp's Avatar Active Member
    Reputation
    21
    Join Date
    Jun 2007
    Posts
    94
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Get your program to startup when Windows starts!

    OK here's my tutorial on how to get YOUR program to startup when Windows does.

    Now, since we are accessing the registry, you will need to import Microsoft.Win32, which contains the part of the .NET Framework that handles the registry.

    There are two different registry directories that handle startup items, HKEY_Current_User and HKEY_Local_Machine. Current User will start the program for the current user only, and the Local Machine will start the program for anyone who uses the computer.

    To add a startup item to the Current_User, you will have to open the registry key and set the value, like so:
    Code:
    Private Sub AddCurrentKey(ByVal name As String, ByVal path As String)
       Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
       key.SetValue(name, path)
    End Sub
    And to remove it:
    Code:
    Private Sub RemoveCurrentKey(ByVal name As String)
       Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
       key.DeleteValue(name, False)
    End Sub
    Okay thats all well and good but how would you use it?

    Well, I am using a Check Box to determine wether or not the registry startup key is set. The "name" and "path" will be set when the function that sets the registry value is called.
    Code:
    If CurrentStartup.Checked Then
       AddCurrentKey("StartupExample", System.Reflection.Assembly.GetEntryAssembly.Location)
    Else
       RemoveCurrentKey("StartupExample")
    End If
    Definitions:
    StartupExample is the name of the project, and will also be the name set in the registry key. System.Reflection.Assembly.GetEntryAssembly.Location gets the current location of the program to store in the registry key.
    Also, another way that you can set the "name" of the startup key other than specifying it, is by using System.Reflection.Assembly.GetEntryAssembly.FullName.

    Now, to set the same startup key in the Local_Machine, just change CurrentUser to LocalMachine

    (please remember that the registry is like an animal if you pull its bones out it will cease to work, so dont mess it up! )

    Enjoy

    Get your program to startup when Windows starts!
  2. #2
    Dombo's Avatar Banned
    Reputation
    622
    Join Date
    Nov 2008
    Posts
    1,421
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Awesome! +2

  3. #3
    PIN's Avatar Active Member
    Reputation
    34
    Join Date
    Mar 2009
    Posts
    192
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, im trying to understand this

  4. #4
    Jonthe838's Avatar Contributor
    Reputation
    83
    Join Date
    Aug 2008
    Posts
    373
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    awsome! will try this later
    Lines of Coding: |||||||||| Goal 1000
    Current: 677 Achived Goals: 500 Lines


  5. #5
    kikpp's Avatar Active Member
    Reputation
    21
    Join Date
    Jun 2007
    Posts
    94
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol did you get it to work?

  6. #6
    Ebonesser's Avatar Member
    Reputation
    33
    Join Date
    Mar 2009
    Posts
    123
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or you could only righ click on the START button and choose EXPLORE ALL USERS,
    browse to the PROGRAMS>>>STARTUP folder and place a shortcut to the program you want to start with windows there

  7. #7
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Registry is better because you don't need to mess around with shortcuts, and also this way is more useful for the things some folk round these parts will make, where the program itself is hidden and they don't want any evidence of it, which seeing as few ever think to look through their registry is a safe bet. Yes, I'm talking about keyloggers and the like.

  8. #8
    Mitron's Avatar Contributor
    Reputation
    127
    Join Date
    Jun 2008
    Posts
    1,326
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats great i wont use it cuz im to noobisch but u get +rep anyways cuz of the greatness ^^

    ----------------------------------------------------------------

  9. #9
    kikpp's Avatar Active Member
    Reputation
    21
    Join Date
    Jun 2007
    Posts
    94
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    awwww....ty mitron. Ya, don't try it if your not good enough yet. Messing with registers can screw up your comp

  10. #10
    visitor's Avatar Contributor
    Reputation
    174
    Join Date
    Mar 2008
    Posts
    307
    Thanks G/R
    16/15
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I didnt know where was the autorun in the registry
    and in VB.NET RegistryKey is Microsoft.Win32.RegistryKey
    Hey I just met you

  11. #11
    2dgreengiant's Avatar ★ Elder ★


    Reputation
    1192
    Join Date
    Feb 2007
    Posts
    7,129
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Start > Programs > Startup :P easier for me heh
    If you need me you have my skype, if you don't have my skype then you don't need me.

  12. #12
    Mitron's Avatar Contributor
    Reputation
    127
    Join Date
    Jun 2008
    Posts
    1,326
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    btw kikpp... is there any possibilty to just make an easier code so the app just starts for the whole machine everytime ?? and do i need to import that Microsoft.Win32 anyway ?? =3

    ----------------------------------------------------------------

  13. #13
    NightUndead's Avatar Member
    Reputation
    13
    Join Date
    Sep 2008
    Posts
    51
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the easy way to startup with Windows, however the program doesn't start until the user is logged in... If you want it to start before that the only way to do it, is through a service (easy to make but besides the point), services are the only thing you can start before a user logs on... Heck I once made a service that started the windows calculator!

  14. #14
    miLl3niUm's Avatar Member
    Reputation
    16
    Join Date
    Jun 2009
    Posts
    312
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't see why this should be legendary, it's pretty simple but good job for taking the time to write it.

  15. #15
    Mitron's Avatar Contributor
    Reputation
    127
    Join Date
    Jun 2008
    Posts
    1,326
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well i actually only need when the user logon it's ment to be a trojan or something but i need to start up when user logon :P and i dont get that part with Microsoft.Win32 thing....

    ----------------------------------------------------------------

Page 1 of 2 12 LastLast

Similar Threads

  1. What you listen to when your programming?
    By Corthezz in forum WoW Memory Editing
    Replies: 35
    Last Post: 02-18-2022, 10:26 AM
  2. [BUG]Get your extra roll when you forgot your weekly seals
    By Iscariote in forum World of Warcraft Exploits
    Replies: 2
    Last Post: 04-30-2015, 04:03 AM
  3. Getting WoW errors when Honorbuddy start. HELP pls !
    By bojan9002 in forum WoW Bots Questions & Requests
    Replies: 3
    Last Post: 09-17-2012, 02:37 PM
  4. Addicted? Startup WoW directly when computer starts! :)
    By Come Undone in forum World of Warcraft General
    Replies: 4
    Last Post: 01-17-2009, 07:34 PM
  5. Get instant Xp when WOTLK Starts
    By Fennas in forum World of Warcraft Exploits
    Replies: 32
    Last Post: 07-31-2008, 08:10 AM
All times are GMT -5. The time now is 05:14 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search