copy %0 shell:startup copy %0 "C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" Start D:\Program\AutoHotkey\AutoHotkeyU32.exe D:\Program\Autorun\Autorun.ahk /* =========================================== 一键设置系统启动后自动运行此脚本 AutoRunSet v1.0 By BoAi =========================================== 更新历史: 使用说明: 运行此脚本会自动设置系统启动后自动运行此脚本 用AutoRuns.exe工具软件可以删除自动运行设置项 */ #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SetTimer,SelfSingleRun,500 SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. SetTitleMatchMode, 2 SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetBatchLines, -1 CoordMode, Mouse CoordMode, Pixel CoordMode, ToolTip ;-- 方法1:在当前用户的开始菜单中启动文件夹中创建此脚本的快捷方式,从而实现在Win7系统启动后自动运行此脚本 ; 最后一个参数中的字母 "i" 将快捷键设成 Ctrl-Alt-I: ;// FileCreateShortcut, %A_ScriptFullPath%, %A_Startup%\AutoRun_AHK.lnk, C:\, "", AutoRun_AHK, , i ;-- 方法2:在所有用户的开始菜单中启动文件夹中创建此脚本的快捷方式,从而实现在Win7系统启动后自动运行此脚本 ; 最后一个参数中的字母 "i" 将快捷键设成 Ctrl-Alt-I: FileCreateShortcut, %A_ScriptFullPath%, %A_StartupCommon%\AutoRun_AHK.lnk, C:\, "", AutoRun_AHK, , i ;-- 方法3:写入值到注册表. ;~ Windows Registry Editor Version 5.00 ;~ [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] ;~ "RTHDVCPL"="C:\\Program Files\\Realtek\\Audio\\HDA\\RtHDVCpl.exe -s" RegWrite, REG_MULTI_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\Run,AutoRun_AHK,%A_ScriptFullPath% ;-- 方法4:写入值到注册表. ;~ Windows Registry Editor Version 5.00 ;~ [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] ;~ "runplus"="C:\\Program Files\\Andisy\\运行精灵\\runplus.exe -hide" RegWrite, REG_MULTI_SZ, HKEY_CURRENT_USER, SOFTWARE\Microsoft\Windows\CurrentVersion\Run,AutoRun_AHK,%A_ScriptFullPath% ;-- 方法5:计划任务 ;-- 方法6:系统服务 ;~ Windows Registry Editor Version 5.00 ;~ [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\QQPCRTP] ;~ "RtpFlag"=dword:00000000 MsgBox,跟随系统启动自动运行测试 ;-- 防止重复运行此脚本 ---------------------------------------- SelfSingleRun() { #SingleInstance ignore loop,30 { DetectHiddenWindows,On Sleep,1000 IfWinExist,BoAi_QQ595076941_AutoRunSet ExitApp } Gui, Show, Hide,BoAi_QQ595076941_AutoRunSet SetTimer,SelfSingleRun,Off }
[…] https://www.autoahk.com/archives/14015 […]