检测系统启动事件

发布于 2024-11-14 04:12:53 字数 98 浏览 4 评论 0原文

我想执行一个仅在Windows系统启动时触发的程序,这里的启动并不意味着程序启动。我可以做些什么来触发我的程序吗?如果可能的话,我想避免弄乱注册表。我使用的是delphi 2010。

I would like to execute a procedure that should be fired only upon windows system startup, and startup here does not mean program startup. Is there anything that I can do to trigger my procedure. If possible, i would like to avoid messing with the registry. I am using delphi 2010.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

荒人说梦 2024-11-21 04:12:53

有很多选项,但所有选项都涉及需要管理员权限的设置。这些选项包括:

  1. 将您的例程放入设置为自动启动的服务中。这将在系统启动时且在任何用户登录之前启动。
  2. 将条目添加到 HKLM\Software\Microsoft\Windows\CurrentVersion\Run。这将在交互式用户登录时执行。
  3. 添加具有适当触发器的计划任务,例如启动时

There are many options, but all will involve settings that require admin rights. These options include:

  1. Put your routine in a service that is set to start automatically. This will start up when the system starts up and before any user has logged on.
  2. Add an entry to HKLM\Software\Microsoft\Windows\CurrentVersion\Run. This will execute when an interactive user logs on.
  3. Add a scheduled task with an appropriate trigger, e.g. At startup.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文