Results 1 to 16 of 16

Thread: Run EXE at Startup

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    11

    Run EXE at Startup

    Hey,

    This is my first post at vbforums, hopefully someone can help! I have a program that I have created and generated the .exe. I want this exe to run when the computer starts. I have seen several other threads with this same problem being addressed but all the answers are "put the exe in startup" or "edit the registry and add the exe as a string in \Run" and on and on. I do not want this exe to run when someone logs into the computer, I want the exe to run when the computer is booted, or when windows displays that loading screen, or shortly after. The systems I run at work run novell and the user needs to log in. So if this exe could run before that user logs in would be what I am looking for. Is this possible to do?

  2. #2
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: Run EXE at Startup

    Hi, welcome to the forums

    Someone correct me if I'm wrong, but as far as I know that's impossible, because when you run the application the VB6 runtime is loaded.
    And I think that won't work.

    I'll do some research on it, as you also got me interested in this
    Delete it. They just clutter threads anyway.

  3. #3
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: Run EXE at Startup

    Oh by the way,
    Just wondering... What does your app need to do before the logon?
    Delete it. They just clutter threads anyway.

  4. #4
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Re: Run EXE at Startup

    You can turn your exe into a service and that should accomplish what you want to do. There are various tools available to do this. Just do a Google search.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    11

    Re: Run EXE at Startup

    I need this exe to notify my team when a windows server reboots. We have several servers running both linux and windows. The linux servers have this automatic email set up, so I wanted to do that same with the windows one. I will try setting up that service and see if that works. I will let you all know! Thanks for the quick replies!

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    11

    Re: Run EXE at Startup

    Let me be a little more clear here... we have several servers... some are running windows, some are running linux, not both! Sorry!

  7. #7
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: Run EXE at Startup

    HKLM/Software/Microsoft/Windows/CurrentVersion/Run is where it goes... that runs when windows starts up. the same key under the HKU hive runs when the user logs in.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    11

    Re: Run EXE at Startup

    That would work if I wanted my exe to run when the user signs in, but I want it to run before anyone signs in.

  9. #9
    Lively Member
    Join Date
    Apr 2009
    Posts
    124

    Re: Run EXE at Startup

    I believe there is a way to do it. Also try to edit your Autoexec.bat file manually and insert the EXE file to run at start-up. I may be wrong, but I will try it to see if it works with my EXE. Then I will send a message back.

  10. #10
    Hyperactive Member Quiver318's Avatar
    Join Date
    Sep 2007
    Posts
    260

    Re: Run EXE at Startup

    I agree with MarkT. Make the program into a Windows Service.

  11. #11

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    11

    Re: Run EXE at Startup

    I tried creating the service and it would not fire when I rebooted. If I tried to start the service manually it would throw an error saying the program did not start in a timely fashion, but it still worked. When I rebooted to test it gave an error saying a windows service could not be started and the program never fired. I also tried editing the autoexec.bat, but that to failed to fire on reboot. Am I missing something important here?!

  12. #12
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: Run EXE at Startup

    I think I've found something.
    Stay tuned
    Delete it. They just clutter threads anyway.

  13. #13

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    11

    Re: Run EXE at Startup

    Oh the suspense!

  14. #14

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    11

    Re: Run EXE at Startup

    Quote Originally Posted by techgnome View Post
    HKLM/Software/Microsoft/Windows/CurrentVersion/Run is where it goes... that runs when windows starts up. the same key under the HKU hive runs when the user logs in.

    -tg

    That only works when someone logs into the workstation. Not quite what I am looking to accomplish. I want the executable to fire before logon.

  15. #15

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    11

    Re: Run EXE at Startup

    Got it! After many hours spent googleing and testing I finally got it!

    Here is what worked:
    Start > Run gpedit.msc
    In the window that pops up go to Computer Configuration > Windows Settings
    Then click on "Scripts" and open "Startup". Click "Add", Browse to where the executable is, click on it, and hit open then click ok.

    This script runs before a user has to login. Such a simple solution. Thank you all for your help and advice! I am going to go pluck out my grey hairs now...

  16. #16
    Addicted Member
    Join Date
    Jan 2009
    Posts
    233

    Re: Run EXE at Startup

    hi Travoiz, make that exe file that you want to run as a service.. check out this link from MS site on how to do it..
    http://support.microsoft.com/kb/251192
    or try this one
    http://www.sw4me.com/wiki/Winserv

    pls. let us know if it helps
    The taller the bamboo grows the lower it bends...

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