简体   繁体   English

我们启动电脑时如何启动windows应用程序

[英]How to start the windows application when we starts the computer

How to start the windows application when we starts the computer.当我们启动计算机时,如何启动 windows 应用程序。 In my application I want to update the current date & time in registry.在我的应用程序中,我想更新注册表中的当前日期和时间。

The easiest way is to add it to the "startup" folder which you can find the Windows button -> All programs.最简单的方法是将其添加到“启动”文件夹中,您可以在该文件夹中找到 Windows 按钮 -> 所有程序。 It might be named differently if you have a localized Windows version.如果您有本地化的 Windows 版本,它的名称可能会有所不同。

Use the "Run" key in the registry.使用注册表中的“运行”键。

See http://support.microsoft.com/kb/314866请参阅http://support.microsoft.com/kb/314866

You can use the Startup folder, thats easy to handle by your users if they do not want it anymore.您可以使用Startup文件夹,如果您的用户不再需要它,这很容易处理。

Then there ist the Run key in the registry, see Andrew' answer.然后注册表中有Run键,请参阅 Andrew 的回答。

Also you might set up a windows service which does things not interactivly and also when no user is logged in. This service can do a single thing, start up automatic und terminate after finishing its work (it does not need to loop like most services).您也可以设置一个 windows 服务,它不会交互地执行操作,也可以在没有用户登录时执行。该服务可以做一件事情,完成工作后自动启动和终止(它不需要像大多数服务一样循环) .

You can use two easy ways to do this.您可以使用两种简单的方法来做到这一点。

Add to Start up folder添加到启动文件夹

Environment.GetFolderPath(Environment.SpecialFolder.Startup) 

Add registry entry添加注册表项

RegistryKey myKey= Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);    
myKey.SetValue("Your Application Name", "\"" + Application.ExecutablePath.ToString() + "\); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Windows启动时启动应用程序 - Start application at when windows Starts 如何在计算机启动时运行我的winform应用程序 - How to run my winform application when computer starts 强制Winforms安装使应用程序在Windows启动时启动 - Forcing Winforms install to make application to start when windows starts 当Windows启动时,如何使我们的表单(应用程序)开始运行? - How to make our form(application) start running when windows starts in C#? 如何在Windows Mobile中启动设备时启动应用程序? - How do you make an application start when the device starts up in Windows Mobile? 在Windows Shell启动之前启动应用程序? - Start Application Before Windows Shell Starts Up? c# 如何检测windows 表单应用程序在计算机启动后首次运行(启动时)? - c# how to detect that the windows form application runs for the first time(on startup) after computer starts? 是否有可能知道应用程序何时在Windows Phone 7中启动? - Is it possible to know when application starts in windows phone 7? 在Windows 8中启动任何应用程序时,如何启动我的C#应用​​程序? - How to launch my C# application when any application starts in Windows 8? 程序启动时如何启动mysql数据库? - How to start mysql database when program starts?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM