应用程序在 Windows 资源管理器之前启动
某些安装应用程序会停止(或似乎停止)正常的 Windows 启动。计算机启动,用户登录,然后安装程序先于其他程序(例如 Windows 资源管理器)启动。
我如何在我自己的程序中复制这种行为?
例如
- 操作系统启动登录
- 程序
- 运行、更新等。
- 其余程序运行(例如Windows资源管理器和启动时运行的程序)
Some installation applications stop (or appear to stop) the normal windows booting. The computer starts, the user logs in and then the installation program starts before others (like Windows explorer).
How can I replicate this behaviour in my own program?
E.g.
- OS Boot
- Login
- The program runs, updates etc.
- The rest of the programs run (e.g. windows explorer and what ever runs on startup)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如果您想在 shell 启动之前启动应用程序,可以向注册表中的
Userinit
值添加一个值。在这个键中:有一个名为
Userinit
的值。更改它,以便您的程序在 userinit.exe 之前运行。例如,要在 shell/其他所有内容初始化之前启动记事本:使用逗号分隔应启动的程序。
这适用于 Windows XP、Vista 和 7。
If you want to start an application before the shell starts, you can add a value to the
Userinit
value in the registry. In this key:There is a value named
Userinit
. Change it so your program is run before userinit.exe. For example, to start notepad before the shell/everything else is initialized:Use commas to separate the programs that should be started.
This works for Windows XP, Vista, and 7.
我还没有尝试过,但我认为这是由注册表项完成的
还有更多注册表项 - 请参阅此处记录的完整列表:
注册表中 RunOnce 键的定义
但是对于您的用例,我建议作为桌面 shell 启动您的应用程序,类似于“vcsjones”建议的解决方案。程序完成后,您可以调用
explorer.exe
开始加载常规桌面。I have not tried it but I assume that this is done by the registry entry
There are even more registry keys - see the complete list documented here:
Definition of the RunOnce Keys in the Registry
But for your use case I would recommend to start your application as desktop shell similar to the proposed solution by "vcsjones". When your program has finished you can call
explorer.exe
to start loading the regular desktop.您应该查看 Windows 任务计划程序。可以安排任务在用户(特定或任何)登录时执行。 Windows 提供的开箱即用的 UI 说明了使用此标准 Windows 功能实际上可以做什么。
另一个解决方案是编写一个 Windows 服务(.msi Windows Installer 实际上是一个服务)。
不过,我不确定您是否能够阻止 Windows 资源管理器...
You should have a look at Windows Task Scheduler. Tasks can be scheduled to execute when a user (specific or any) logs on. The UI provided out-of-the-box by Windows illustrates what can actually be done with this standard Windows feature.
Another solution is to write a Windows service (the .msi Windows Installer is in fact a service).
I'm not sure you will be able to block Windows Explorer though...
您可以将 Windows 批处理文件
.bat
包裹在explorer.exe
周围,但这并不能真正确保它始终在 explorer.exe 之前启动
您可能会更改某些注册表值选择另一个“shell”而不是资源管理器。 。
如果这就是您真正想要的。
You could possibly wrap a windows batch file
.bat
aroundexplorer.exe
But that wouldn't really make sure it's always started before explorer.exe
You could possibly change some registry value to select another 'shell' instead of explorer for that . .
If that is what you are actually looking for.
https://github.com/sylveon/EarlyStart
打开会话时,在 Windows 资源管理器之前启动程序。
https://github.com/sylveon/EarlyStart
Launches programs before Windows Explorer when opening a session.