Computer startup
When a computer turns on, it searches for files to run as part of the startup process. This page details this process.
For information about creating a basic startup file, see Running programs on computer startup.
-
/rom/autorun: Computers first look in the/rom/autorunfolder, and run every file in that folder. This folder is empty by default, but may be extended by datapacks or other mods. See the example datapack for an example. -
If the
shell.allow_disk_startupsetting istrue, then connected disk drives are searched for astartupfile,startup.luafile, orstartup/directory. The first disk containing these files will be used for startup.- The
startup(orstartup.lua) file will be run. - All programs under
startup/will be run.
The order disks are iterated over is not defined, and so it is recommended to only have one disk containing startup files connected to a computer.
- The
-
If no startup files are found on a disk, and the
shell.allow_startupsetting istrue, then the root directory is searched for startup files in the same way (startuporstartup.lua, then all files instartup/).
When listing a files from a directory (either startup/ or rom/autorun), the result of fs.list is used
directly. This will always return files in lexicographical order. This means that startup/a.lua will always run before
startup/b.lua.