Windows加载时启动应用程序 [英] Starting an application when windows load

查看:114
本文介绍了Windows加载时启动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在Windows加载时在后台加载应用程序,达到目的,然后关闭.我看过Google并发现了很多,但对我没什么用.

很多地方都提到了注册表,说实话,如果可以避免的话,那不是我想走的路!这有点超出我的理解范围,我不想更改可能导致系统问题的事物!

最好按计划创建该应用程序,安装到Windows,然后将其设置为在启动时运行.还是有一种更合适的方式来做到这一点?

预先感谢,

Dan

I am looking to load an application in the background when windows loads, do it''s purpose and then close. I have looked on google and found alot, but not alot that is useful to me.

Registeries are mentioned alot and to be honest that isn''t the way I would like to go if at all avoidable! It is a bit out of my depth and I don''t want to be changing things that could cause issues with the system!

Would it be better to create the app as planned, install to windows and then set it as run on startup. Or is there a more eligant way of doing this?

Thanks in advance,

Dan

推荐答案

我将构建Windows服务并将其设置为自动启动:

http://msdn.microsoft.com/en-us/library/d56de412%28v = VS.100%29.aspx [ ^ ]
I''d build a windows service and set it to start automatically:

http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.100%29.aspx[^]


最简单的方法是在Windows的Startup目录中为应用程序添加快捷方式.

例如C:\ Documents and Settings \所有用户\开始菜单\程序\启动

正如您提到的,注册表是执行此操作的另一种方法.虽然您是正确的,并且您需要在注册表中稍加小心,但实际上并没有那么困难.

*开始->运行-> regedit
*展开注册表项,直到找到HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run
*在运行"键上单击鼠标右键,然后选择新建->字符串值''
*将会在右侧创建一个名为新值#1"的值
*双击它,在值数据"文本框中输入应用程序的完整路径

就这样-您完成了!

我不会真的为您需要实现的服务推荐Windows服务,以上两种方法最好是先运行某些程序,然后退出". Windows服务在后台启动并继续运行,它们是在为其他应用程序和服务提供功能.那不是你想做的.
The easiest way would just be to add a shortcut to your application in the Startup directory of Windows.

e.g. C:\Documents and Settings\All Users\Start Menu\Programs\Startup

As you mentioned, the registry is another way to do this. While you''re correct & you need to be a bit careful in the registry, it''s honestly not that difficult.

* Start -> Run -> regedit
* Expand the registry keys until you find HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
* Right mouse on the ''Run'' key and choose ''New -> String Value''
* A value will be created on the right hand side called ''New Value #1''
* Double click this, enter the full path to your application in the ''Value Data'' text box

That''s it - You''re done!

I wouldn''t really recommend a windows service for what you need to achieve, the above 2 methods are the best to ''run something, then exit''. Windows services start and continue running in the background, they are there to provide functionality for other applications and services. That''s not what you''re trying to do.


这篇关于Windows加载时启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆