-4

In another post, I am told that this is the way to run something at startup. A registry key is created:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

I am supposed to place a filepath under that key.

What file types are allowable (or recommended) at the end of that path? *.EXE? (native? managed?) *.BAT?

TIA

Travis Banger
  • 697
  • 1
  • 7
  • 19
  • 3
    That's not at boot time, that's after user login. And thus you can run anything you want there, but keep in mind that anything you add delays the point where the user can use their computer. – Joey Jan 16 '14 at 15:48
  • Thanks, Joey! I intend to place my app in a separate thread, and it only takes a few seconds. – Travis Banger Jan 16 '14 at 16:55
  • It probably still reads things from the disk (at the very least your program) and in my experience that's what slows down the boot, not CPU load. – Joey Jan 16 '14 at 19:14

2 Answers2

2

A simple way to run some thing at startup is to put the *.exe or *.bat in the folder

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

If there is no folder , create one and place the .exe/.bat

vathsa
  • 303
  • 1
  • 7
  • Thanks. I have used that solution in other scenarios. In this case, I do not want the users to be able to circumvent the process. – Travis Banger Jan 16 '14 at 16:54
  • It can't be circumvented if you put it in the shared startup folder. Of course, users can kill your process regardless of how it was started. – MSalters Jan 17 '14 at 10:50
2

Pretty much anything allowed, recommended is a native application which doesn't drag in a lot of other stuff. I.e. link the CRT statically.

BTW, "I intend to place my app in a separate thread" doesn't make sense. An app gets its own process and thus its own thread anyway.

BTW2, "it only takes a few seconds" - I hope you mean milliseconds. At boot time, seconds are unacceptable.

MSalters
  • 173,980
  • 10
  • 155
  • 350