Windows 자동 시작 AutoIT 응용 프로그램

AutoIT 응용 프로그램을 자동으로 시작하기 위해 Windows 시작 폴더에 대한 링크 추가

C05348A3-9AB8-42C9-A6E0-81DB3AC59FEB
           

AutoIT 코드 샘플 - 사용자가 Windows에 로그온할 때마다 AutoIT 응용 프로그램을 자동 시작하기 위해 사용자의 Windows 시작 폴더에 바로 가기를 추가합니다. 이 스크립트는 양식에 정의된 체크박스가 있다고 가정하고 체크 또는 체크 해제 이벤트에서 바로 가기를 동적으로 생성하거나 삭제합니다.

;===============================================================================
; Description:		Add link to Windows startup folder
; Author(s):		Videre Research, LLC - http://videreresearch.com
;===============================================================================
...
While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			;Do something
		Case $Checkbox1
			If BitAND(GUICtrlRead($Checkbox1), $BN_CLICKED) = $BN_CLICKED Then
				If _GUICtrlButton_GetCheck($Checkbox1) Then
					ConsoleWrite("Checkbox checked... " & @CRLF)
					If Not FileExists(@StartupDir & "\linkName.lnk") Then
						FileCreateShortcut(@ScriptFullPath, @StartupDir & "\linkName.lnk", @ScriptDir, "", "AutoIT Script Description")
					EndIf
				Else
					ConsoleWrite("Checkbox unchecked... " & @CRLF)
					If FileExists(@StartupDir & "\linkName.lnk") Then
						FileDelete(@StartupDir & "\linkName.lnk")
					EndIf
				EndIf
			EndIf
	EndSwitch
WEnd

사용자에게 확인란의 상태를 올바르게 표시하기 위해 응용 프로그램을 시작할 때 바로 가기가 있는지 확인할 수도 있습니다.

...
If FileExists(@StartupDir & "\linkName.lnk") Then
	 _GUICtrlButton_SetCheck($Checkbox1)
EndIf
댓글을 게시했습니다: 0