1 Star 5 Fork 2

NEVSTOP-LAB/LabVIEW-Program-run-on-startup

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

LabVIEW-Program-run-on-startup

LabVIEW范例:如何让程序在系统启动时自启动

[!NOTE] Example 依赖 NEVSTOP-Programming-Palette.

需要了解

  1. MSDN:Run and RunOnce Registry Keys
Use Run or RunOnce registry keys to make a program run when a user logs on.
The Run key makes the program run every time the user logs on,
while the RunOnce key makes the program run one time, and then the key is deleted.
These keys can be set for the user or the machine.

The data value for a key is a command line no longer than 260 characters.
Register programs to run by adding entries of the form description-string=commandline.
You can write multiple entries under a key.
If more than one program is registered under any particular key,
the order in which those programs run is indeterminate.

The Windows registry includes the following four Run and RunOnce keys:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce

  1. Pass Command Line Arguments to a LabVIEW Executable

image

How-To

  1. 创建复用VI,用于创建导入注册表的包含自启动信息的 reg 文件.

[!TIP] 如果中文出现乱码如何处理:修改 reg文件的编码方式,设置为 ANSI 或 UTF-16 LE 编码。 reg文件导入注册表后出现中文乱码的解决方法

[!TIP] 此VI已包含在 NEVSTOP-Programming-Palette 4月Rleases 的 application Palette中,直接生成的reg 文件是 UTF-16 LE 编码.

image

  1. 合适的地方调用,范例中,在 EXE 启动后,每次都创建一次,保证 exe 路径发生变化后,注册表信息也能及时更新

image

  1. 按照 Pass Command Line Arguments to a LabVIEW Executable 配置编译 exe

  2. 运行 exe后, 双击 reg 文件, 将自启动信息导入注册表,重启系统后,程序会自启动, 可以在任务管理器中查看到启动项。

image

MIT License Copyright (c) 2024 NEVSTOP-LAB Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

LabVIEW范例:如何让程序在系统启动时自启动 展开 收起
LabVIEW
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/NEVSTOP-LAB/LabVIEW-Program-run-on-startup.git
git@gitee.com:NEVSTOP-LAB/LabVIEW-Program-run-on-startup.git
NEVSTOP-LAB
LabVIEW-Program-run-on-startup
LabVIEW-Program-run-on-startup
main

搜索帮助