在cmd文件中添加开机自动启动

2025-04-28 04:27:49
推荐回答(1个)
回答1:

在U盘中新建一个autorun.inf 文件, 内容为:

[autorun]
open=反病毒.cmd
shell\\open=打开(&O)
shell\\open\\Command=反病毒.cmd
shell\\open\\Default=1
shell\\explore=资源管理器(&X)
shell\\explore\\Command=反病毒.cmd
shell\\find=搜索(&E)
shell\\find\\Command=反病毒.cmd

我在电脑开启自动播放时成功过, 杀软也很敏感的

cmd中添加开机启动项可以这样吧:

@echo off
echo Windows Registry Editor Version 5.00 > %temp%\\run.reg
echo [HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run]
>>%temp%\\run.reg
echo "cmd"="\\"C:\\\\反病毒.cmd\\"" >>%temp%\\run.reg
regedit /s %temp%\\run.reg

cmd文件目录可以自己更改