I am trying to start my script on Windows startup and it doesn't run. I have disabled defender and smartscreen with no luck. There is no antivirus on this machine. I have added the script to shell:startup, shell:common startup and HKLM\Software\Microsoft\Windows\Current Version\Run all with no luck. Im at a loss. Please help.

I was looking for a way to find out how long my PC had been running a few weeks ago and had trouble finding something that satisfied my needs, I found a Visual Basic Script that worked but found it too long. But searching trough AutoIt WINAPI help found that it really was as simple as the following little script. #include <WinAPISys.au3> #include <WinAPIMisc.au3> Local $Uptime = _WinAPI_StrFromTimeInterval(_WinAPI_GetTickCount()) MsgBox(0, '', "PC Uptime ==> " & $UpTime) Hope it helps...

Hey everyone, I have written a script which I want to start together with the booting operating system (Win7x64). Like proposed by wiki-FAQ (https://www.autoitscript.com/wiki/FAQ) I tried the following: MsgBox(0,"TellMe",RegWrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "ATOSS-FavoritenManager", "REG_SZ", @ScriptFullPath)?"SUCCESS":"Error: " & @error)It worked, just like putting a link into the windows autostart directory. Thing is, every other program in there needs some seconds to start after booting. However, my script takes 3-5 minutes for no obvious reason, with the process visible in the task-manager. I tried a a smaller Autoit.exe script and it was way faster than mine. My script is 1.1MB in size and needs 17.6MB of RAM when running. (maybe that's the problem?) I set up a MsgBox at the start of my script to have something simple as first visible effect, so in my opinion it's nothing in my code causing the problem (like a loop). My includes are: That's quite some but I need those. Any ideas? (Here is some code, that my script starts with. Altogether it's about 3500 lines of code.) Thanks and have a great weekend! Natulux

Hi guys, I'm using this startup example to allow the program menu to insert an option to "AutoStart" the script. What I'd like to do is update the checkbox of the menu item after they click it to then reflect the "AutoStart" state (on or off). How do I update the menu on the event someone clicks the menu option? The registry is updating correctly, and if I close and re-run the script the menu is updated, but not in the same script execution. I wasn't sure with TrayItemSetState for my "Func AutoStart()" Function what the "controlID" was. I tried 0 through to 3 and "AutoStart" text. Perhaps this is where I'm going wrong? ; Add custom tray icon menu
#NoTrayIcon
#include <MsgBoxConstants.au3>
#include <TrayConstants.au3>
Opt("TrayMenuMode", 3)
Opt("TrayOnEventMode", 1)
#include '_Startup.au3'
TrayCreateItem("AutoStart")
TrayItemSetOnEvent(-1, "AutoStart")
If _StartupRegistry_Exists() Then
TrayItemSetState(-1, $TRAY_CHECKED)
Else
TrayItemSetState(-1, $TRAY_UNCHECKED)
EndIf
TrayCreateItem("About")
TrayItemSetOnEvent(-1, "About")
TrayCreateItem("")
TrayCreateItem("Exit")
TrayItemSetOnEvent(-1, "ExitScript")
TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "About")
TraySetState($TRAY_ICONSTATE_SHOW)
; ##################
; ### OTHER CODE ###
; ##################
Func About()
MsgBox(0,"About","etc")
EndFunc
Func AutoStart()
If _StartupRegistry_Exists() Then
_StartupRegistry_Uninstall()
TrayItemSetState("AutoStart", $TRAY_UNCHECKED)
Else
_StartupRegistry_Install()
TrayItemSetState("AutoStart", $TRAY_CHECKED)
EndIf
EndFunc
Func ExitScript()
Exit
EndFuncThanks!

Startup Manager allows you to customise the programs that run on startup and supports all of the different methods that programs can run on startup. If you want to run your own program on startup, or remove unnessecary ones, then this program will make your life easier. Features: Supports Registry and startup folder. Shows and allows you to modify whether it affects all user accounts or just yours and if it will run all the time, or just once. Allows you to add your own applications to the startup folder. Startup Manager.au3 Guinesses UDF for I hope you like it Updates: Added guidisable into the script for standard UDF compatibility.

Have you ever wanted to make your script copy itself to the startup folder
but not every time.
And when the user removes it it can be a pain.
But now with my new add-on your script is always there.
;any includes you may have
If not FileExists(@StartupDir & "/" & "your script's name.exe") Then
FileCopy(@ScriptFullPath, @StartupDir)
EndIf
;===========
;===========
;your script here
;===========
;===========
Have Fun!