2

How is it possible to have an executable run automatically on startup? Is it possible by having a shortcut to the .exe in the startup folder in the All programs section of the start menu? If that is correct, what is the full directory of the startup folder?

  • 1
    What version of Windows? – Uri Mar 31 '10 at 2:01
  • I suppose Windows 7. If not it would be equally interesting to know about windows xp and vista also. – Maddest Hatter Mar 31 '10 at 2:03
  • Im sorry if this is amateurish, but would it be possible for an explanation of how to use the following code? Private Const cPGM = "C:\VB Forum\startup\TestStartup.exe" Dim oShell As IWshShell_Class Set oShell = New IWshShell_Class oShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Run\MyVBApp", _ cPGM, "REG_SZ" thanks for your patience – Maddest Hatter Mar 31 '10 at 2:10
  • that will set a registry key that allows "C:\VB Forum\startup\TestStartup.exe" to run at startup – Remus Rigo Dec 30 '10 at 14:57
7

There are many options, the Startup folder being only one of them.

A detailed guide is available here: http://oreilly.com/pub/a/oreilly/windows/ron/startup_0401.html

The most popular option these days is the registry - see the guide link above for details.

| improve this answer | |
  • That's the answer. You don't need to look any further. – Anonymous Mar 31 '10 at 2:36
3

The preferred way is to create a registry entry, such as in HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run. The key needs to be of type REG_SZ (0-terminated string) and contain a unique name as Name and the program's full executable path as Data.

| improve this answer | |
  • 1
    I disagree. The registry has less transparency to the average user than the startup folder. Users don't generally like it when programs add startup items of dubious necessity. – Hugh Allen Mar 31 '10 at 4:33
2

Yet another method is to use the task scheduler found under accessories/system tools. Create a task that launches the program at startup.

| improve this answer | |
0

C:\Users\YOURUSERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

| improve this answer | |
  • 1
    Be wary of non-English versions here!! There are known ways to get special folders under Windows. – paxdiablo Mar 31 '10 at 2:07
  • I notices the tags didn't include a tag for any programming language so I assumed he just wanted a path. I think maybe his question if not asking for code example should be placed on superuser instead. – Art W Mar 31 '10 at 2:13
  • You should still use the environment variables. %AppData%\Microsoft\Windows\Start Menu\Programs\Startup – Scott Chamberlain Jul 13 '14 at 17:24
0

the simpliest way is to create a shortcut and to drag it it Startup folder (drag over start button, programs, start and drop it there)

If you want to see the path, just r-click on startup folder and select open

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy