1.运行 shell:startup 命令,如下:

windows开机启动bat文件-LMLPHP

2、创建bat的快捷方式,把改快捷方式添加到,C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp目录下

windows开机启动bat文件-LMLPHP

3.编辑注册表 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run ,如下:

windows开机启动bat文件-LMLPHP

编写注册表脚本(将以下代码保存为.reg文件即可):

添加开机启动脚本到注册表

@echo off
setlocal
cd /d %~dp0
set "UMP_HOME=%cd%"
set "UMP_BIN=%UMP_HOME%\ump_start.bat"
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "AutoStartUMP" /t REG_SZ /d "%UMP_BIN%" /f echo add umpserver to startMenu of system successfully....
if "%2" NEQ "-np" @pause
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "AutoStartUMP" /t REG_SZ /d "%UMP_BIN%" /f,是添加到注册表中

删除注册表中的开机启动项
@echo off

reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v AutoStartUMP /f

echo delete umpserver from startMenu of system successfully....
if "%2" NEQ "-np" @pause
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v AutoStartUMP /f,是删除注册表中的开机启动项

4.编辑本地组策略 gpedit.msc,如下:

windows开机启动bat文件-LMLPHP

windows开机启动bat文件-LMLPHP

05-06 03:31