Results 1 to 3 of 3

Thread: autostart app with windows - 2 questions

  1. #1

    Thread Starter
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,604

    autostart app with windows - 2 questions

    hey guys.

    first question, how can i make my application start up when windows starts up?

    second, i want before windows loads (in autoexec I guess) to have the screen still in dos to pause and ask a question

    would you like to run the program (My App)? Y/N

    If the person chooses no, Windows will load as usual and not load my application,
    if the person chooses yes, windows will load my application when it starts.

    I guess this will probably be in batch files that run from the autoexec. Is that right?

    If you know how to do this, could you please let me know.
    Thanks
    Wengang
    Wen Gang, Programmer
    VB6, QB, HTML, ASP, VBScript, Visual C++, Java

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Well, you've got 2 options really :

    • Finding out what version of windows the user has, then finding the start menu folder, and putting your app or a shortcut to your app into the start menu\Startup folder ...
    • The much simpler way of the registry. Plus, this way the users won't delete this from starting up.

      Place a new key in one of the following folders :
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce

      For looking at how to write to the registry take a look at this page ... Basically, you need a dword key put in there. Doesn't matter what you call it, but set the value equal to the path to your file -

      i.e. My_New_Key as the name, "C:\Path\File.exe" as the value.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    As for the second question, I can't help you really with that one, but you're right in that it's the Autoexec.bat file.

    Be warned that this isn't actually needed by the windows startup, so if you have a clever bastard user, they might have disabled windows from looking at this to boot faster - not likely though granted.

    Do a search on this site for autoexec as this has been answered at least 3 times to my knowledge. Hope the above helps for no.1

    Alex

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

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