Hi,
When I wanted my custom hotkeys script to start up when my computer booted it took a little digging to find the Startup folder. I wrote a gui that allows you to select programs or scripts via browsing or drag and drop to have added (or removed) to the default startup programs.
Note: Selecting a program by itself does not add the program/script. You must also click add shortcut. I also only allow you to delete shortcuts since I figured it might be dangerous to allow you to delete any other file extension.
I am by no means any sort of an expert in AHK (actually quite the opposite) and I haven't used it in over year until yesterday (I had to look up how to redefine ctrl+c and ctrl+v

) So there are probably some errors, but the general functionality of the program seems to work well. You will probably also notice I worked heavily off examples.
Let me know if you have any suggestions:
Code:
;Thomas McCurdy
;b0ot Startup
; Select or de-select all rows by specifying 0 as the row number:
LV_Modify(0, "Select") ; Select all.
LV_Modify(0, "-Select") ; De-select all.
LV_Modify(0, "-Check") ; Uncheck all the checkboxes.
; Auto-size all columns to fit their contents:
LV_ModifyCol() ; There are no parameters in this mode.
Gui, +Resize
;Gui, Add, Edit, vMainEdit WantTab W600 R20
Gui, Add, Text, center, Welcome to the b0ot's startup `n ______~~--==''''_''''==--~~______ `n \__ Created by: Tom McCurdy __/
Gui, Add, Text,, Current Programs Runnings (.ink = Shortcut)
Gui, Add, Button, gSelectFileADD, Select Path
Gui, Add, Button, x+20 gAddShortCut, Add Shortcut
Gui, Add, Button, x+20 gDeleteItem, Delete
Gui, Add, Button, x+20, Switch View
Gui, Add, Button, x+20 gRefreshBaby, Refresh
Gui, Add, Text,x-0, Current Program/Script to Add
Gui, Add, Text, w400 vSelectedFile, No File Selected
;Gui, Add, ListView, Options
Gui, Add, ListView, xm r20 w500 vMyListView gMyListView, Name | Type
ImageListID1 := IL_Create(10)
ImageListID2 := IL_Create(10, 10, true)
LV_SetImageList(ImageListID1)
LV_SetImageList(ImageListID2)
Menu, MyContextMenu, Add, Open, ContextOpenFile
Menu, MyContextMenu, Add, Properties, ContextProperties
Menu, MyContextMenu, Default, Open
Gui, Show
goto, RefreshBaby
return
RefreshBaby:
LV_Delete()
VarSetCapacity(Filename, 260)
sfi_size = 352
VarSetCapacity(sfi, sfi_size)
GuiControl, -ReDraw, MyListView
Loop %A_Startup%\*.*
{
FileName := A_LoopFileFullPath ; Must save it to a writable variable for use below.
; Build a unique extension ID to avoid characters that are illegal in variable names,
; such as dashes. This unique ID method also performs better because finding an item
; in the array does not require search-loop.
SplitPath, FileName,,, FileExt ; Get the file's extension.
if FileExt in EXE,ICO,ANI,CUR
{
ExtID := FileExt ; Special ID as a placeholder.
IconNumber = 0 ; Flag it as not found so that these types can each have a unique icon.
}
else ; Some other extension/file-type, so calculate its unique ID.
{
ExtID = 0 ; Initialize to handle extensions that are shorter than others.
Loop 7 ; Limit the extension to 7 characters so that it fits in a 64-bit value.
{
StringMid, ExtChar, FileExt, A_Index, 1
if not ExtChar ; No more characters.
break
; Derive a Unique ID by assigning a different bit position to each character:
ExtID := ExtID | (Asc(ExtChar) << (8 * (A_Index - 1)))
}
; Check if this file extension already has an icon in the ImageLists. If it does,
; several calls can be avoided and loading performance is greatly improved,
; especially for a folder containing hundreds of files:
IconNumber := IconArray%ExtID%
}
; Get the high-quality small-icon associated with this file extension:
if not DllCall("Shell32\SHGetFileInfoA", "str", FileName, "uint", 0, "str", sfi, "uint", sfi_size, "uint", 0x101) ; 0x101 is SHGFI_ICON+SHGFI_SMALLICON
IconNumber = 9999999 ; Set it out of bounds to display a blank icon.
else ; Icon successfully loaded.
{
; Extract the hIcon member from the structure:
hIcon = 0
Loop 4
hIcon += *(&sfi + A_Index-1) << 8*(A_Index-1)
; Add the HICON directly to the small-icon and large-icon lists.
; Below uses +1 to convert the returned index from zero-based to one-based:
IconNumber := DllCall("ImageList_ReplaceIcon", "uint", ImageListID1, "int", -1, "uint", hIcon) + 1
DllCall("ImageList_ReplaceIcon", "uint", ImageListID2, "int", -1, "uint", hIcon)
; Now that it's been copied into the ImageLists, the original should be destroyed:
DllCall("DestroyIcon", "uint", hIcon)
; Cache the icon to save memory and improve loading performance:
IconArray%ExtID% := IconNumber
}
; Create the new row in the ListView and assign it the icon number determined above:
LV_Add("Icon" . IconNumber, A_LoopFileName, FileExt)
}
GuiControl, +Redraw, MyListView ; Re-enable redrawing (it was disabled above).
LV_ModifyCol() ; Auto-size each column to fit its contents.
; Make the Size column at little wider to reveal its header.
return
ButtonSwitchView:
if not IconView
GuiControl, +Icon, MyListView ; Switch to icon view.
else
GuiControl, +Report, MyListView ; Switch back to details view.
IconView := not IconView ; Invert in preparation for next time.
return
MyListView:
if A_GuiEvent = DoubleClick
{
LV_GetText(RowText, A_EventInfo) ; Get the text from the row's first field.
ToolTip You double-clicked row number %A_EventInfo%. Text: "%RowText%"
}
return
GuiDropFiles: ; Support drag & drop.
Loop, parse, A_GuiEvent, `n
{
SelectedFileChoices = %A_LoopField% ; Get the first file only (in case there's more than one).
break
}
GuiControl,,SelectedFile,%SelectedFileChoices%
return
SelectFileADD:
FileSelectFile, SelectedFileChoices, 3, , Open a file, Program/Script (*.exe; *.ink; *ahk;)
GuiControl,,SelectedFile,%SelectedFileChoices%
return
AddShortCut:
FullfileName = %SelectedFileChoices%
SplitPath, FullFileName, name, dir, ext, name_no_ext
FileCreateShortcut, %SelectedFileChoices%, %A_Startup%\%name_no_ext%.lnk
Goto, Refreshbaby
return
GuiContextMenu: ; Launched in response to a right-click or press of the Apps key.
if A_GuiControl <> MyListView ; Display the menu only for clicks inside the ListView.
return
; Show the menu at the provided coordinates, A_GuiX and A_GuiY. These should be used
; because they provide correct coordinates even if the user pressed the Apps key:
Menu, MyContextMenu, Show, %A_GuiX%, %A_GuiY%
return
ContextOpenFile: ; The user selected "Open" in the context menu.
ContextProperties: ; The user selected "Properties" in the context menu.
; For simplicitly, operate upon only the focused row rather than all selected rows:
FocusedRowNumber := LV_GetNext(0, "F") ; Find the focused row.
if not FocusedRowNumber ; No row is focused.
return
LV_GetText(FileName, FocusedRowNumber, 1) ; Get the text of the first field.
LV_GetText(FileDir, FocusedRowNumber, 2) ; Get the text of the second field.
IfInString A_ThisMenuItem, Open ; User selected "Open" from the context menu.
Run %FileDir%\%FileName%,, UseErrorLevel
else ; User selected "Properties" from the context menu.
Run Properties "%FileDir%\%FileName%",, UseErrorLevel
if ErrorLevel
MsgBox Could not perform requested action on "%FileDir%\%FileName%".
return
ContextClearRows: ; The user selected "Clear" in the context menu.
RowNumber = 0 ; This causes the first iteration to start the search at the top.
Loop
{
; Since deleting a row reduces the RowNumber of all other rows beneath it,
; subtract 1 so that the search includes the same row number that was previously
; found (in case adjacent rows are selected):
RowNumber := LV_GetNext(RowNumber - 1)
if not RowNumber ; The above returned zero, so there are no more selected rows.
break
LV_Delete(RowNumber) ; Clear the row from the ListView.
}
return
GuiSize: ; Expand or shrink the ListView in response to the user's resizing of the window.
if A_EventInfo = 1 ; The window has been minimized. No action needed.
return
; Otherwise, the window has been resized or maximized. Resize the ListView to match.
GuiControl, Move, MyListView, % "W" . (A_GuiWidth - 20) . " H" . (A_GuiHeight - 40)
;%
return
GuiClose: ; When the window is closed, exit the script automatically:
ExitApp
return
DeleteItem:
Loop, % LV_GetCount("selected") ;%
row := LV_GetNext()
LV_GetText(Filename, row,1)
LV_GetText(Filetype, row,2)
If FileType <> lnk
{
MsgBox, Sorry This Program will only delete lnk (shortcut) files. Any other filetype is too risky.
return
}
FileDelete, %A_Startup%\%FileName%
goto, RefreshBaby
return
[/code]