使用 RunOnce 延迟启动
我有一个程序想在 Windows 启动时启动。所以我将程序写入注册表值SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce。 Windows 启动时该程序立即运行。
但是,它会在启动任何其他进程之前运行该程序。我希望在我的桌面启动并且所有其他系统进程启动后启动我的程序。我该怎么做?
编辑:所以我在我的程序中添加了延迟。无论我在程序中设置什么样的延迟,在我的程序运行之前,桌面等进程都不会启动。
I have a program that I want to start at Windows start up. So I wrote the program to the registry value SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce. The program runs immediately when Windows starts up.
However, it runs the program before any of the other processes are started. I would like to have my program start up after my Desktop has started and all the other system processes have started. How would I do this?
Edit: So I have added a delay in my program. None of the processes like desktop start until after my program has run no matter what kind of delay I put in my program.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据微软:
那么这是否意味着如果您将一个执行 Sleep(INFINITE) 的程序放在 RunOnce 键中,它将阻止您的计算机启动?有趣的。
只需使用该文章中提到的其他键之一即可。或者,如果您需要 RunOnce 的语义,请使用启动实际程序后退出的帮助程序。
According to Microsoft:
So does that mean if you put a program that does Sleep(INFINITE) in the RunOnce key, it will prevent your machine from starting up? Interesting.
Just use one of the other keys mentioned in that article. Or if you need the semantics of RunOnce, use a helper program that exits after launching the real program.