Results 1 to 6 of 6

Thread: Startup with Windows

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2006
    Posts
    52

    Startup with Windows

    For example Microsoft Office automatically starts up when Windows starts unless told otherwise via msconfig.

    Is it possible for a programme made in VB6 to start up with Windows?

    If so, could anybody tell me the code?

    Thanks,

    Piratescotty.

  2. #2
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Startup with Windows

    you can do it by adding your app path to the Software\Microsoft\Windows\CurrentVersion\Run registry key, search the forum for registry theres loads of sample code

    here is the easiest way...

    VB Code:
    1. Set wshshell = CreateObject("WScript.Shell")
    2. wshshell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\[B]YOUR_APP_NAME[/B]", App.Path & "\" & App.EXEName & ".exe"

    you can do it with API also.
    Chris

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2006
    Posts
    52

    Re: Startup with Windows

    Would I put that code in the Form Load?

    I'm pretty new to the registry stuff, so does anyone have any examples as I have no idea what I'm looking for!

  4. #4
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Startup with Windows

    well if you wanted it to set the key on form load then yes, or maybe you want to put it in a button? its up to you
    Chris

  5. #5

    Thread Starter
    Member
    Join Date
    Apr 2006
    Posts
    52

    Re: Startup with Windows

    Cheers 182, it worked!

  6. #6
    Lively Member
    Join Date
    Jun 2006
    Posts
    98

    Re: Startup with Windows

    Quote Originally Posted by the182guy
    you can do it by adding your app path to the Software\Microsoft\Windows\CurrentVersion\Run registry key, search the forum for registry theres loads of sample code

    here is the easiest way...

    VB Code:
    1. Set wshshell = CreateObject("WScript.Shell")
    2. wshshell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\[B]YOUR_APP_NAME[/B]", App.Path & "\" & App.EXEName & ".exe"

    you can do it with API also.
    Hi, sorry i know this is an older thread. But how would i remove that from starting up everytime by pressing a button. Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width