This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
KredosRyze's profile picture

Copy or Move from floppy to Computer

Started by KredosRyze, 06 June 2014 - 06:51 PM
KredosRyze #1
Posted 06 June 2014 - 08:51 PM
I basically want to make like an auto-installer where you put the floppy disk in and it auto installs a startup program on the computer where the computer will keep the newly installed program and run it every time on startup. If i worded this in a confusing manner then I'll try to rephrase it. Thanks!
theoriginalbit #2
Posted 07 June 2014 - 01:43 AM
Simply call the installing program 'startup' on the floppy disk. when the computer turns on it will run that startup script.
Depending on how you want to install you'll either need to use shell.run("pastebin get <code> startup") or the FS API.
matt2887 #3
Posted 07 June 2014 - 08:42 AM

fs.delete("startup")
fs.copy("disk/programName", "startup")
shell.run("startup")

This will first delete any startup program from the computer, then copy disk/ whatever your program name is, to the program name startup on the computer, then it will run the program startup.
matt2887 #4
Posted 07 June 2014 - 09:34 AM
Taking a look at my post I figured out there's something I left out. The code i provided you should be labeled startup on the disk, and you should save your program on the disk. So say you have a program named "test" on the disk, You would create a program on the disk called startup and enter the code like this.

fs.delete("startup")
fs.copy("disk/test", "startup")
shell.run("startup")

Hopefully I've explained it a little less confusing than before :)/>