11 posts
Location
Austria
Posted 29 August 2015 - 01:55 AM
I am making an Installer for my own OS, and it's nearly done. One thing is missing: The actual installing. I got the startup file and a "Wundows 1" file on my Floppy Disk. I want the "Wundows 1" file to be the new startup file of the connected PC.
I would really apprechiate a quick answer. :)/>
~ Mika
3057 posts
Location
United States of America
Posted 29 August 2015 - 02:11 AM
Assuming there is one disk drive connected to the computer, and the file in question is named "Wundows" (spaces will mess things up here!) you can use this:
>cp disk/Wundows startup
11 posts
Location
Austria
Posted 29 August 2015 - 02:33 AM
Can't you use cp only in the Computer Console? I want to copy "Wundows" to the PC and rename it to "startup" after I did some things in the Floppy Disk-Startup. Sorry if I'm misunderstanding something, but I started with CC today and I don't have that much experience :)/>
957 posts
Location
Web Development
Posted 29 August 2015 - 06:17 AM
In the floppy disk's startup, you can add this line:
shell.run("cp disk/Wundows startup")
'shell.run' will execute the string you give it as if you'd run it in the computer's console.
119 posts
Posted 29 August 2015 - 06:48 AM
In the floppy disk's startup, you can add this line:
shell.run("cp disk/Wundows startup")
'shell.run' will execute the string you give it as if you'd run it in the computer's console.
That will try to run the program 'cp disk/Wundows startup', not 'cp' with the rest as arguments. It should be:
shell.run("cp","disk/Wundows","startup")
7083 posts
Location
Tasmania (AU)
Posted 29 August 2015 - 07:29 AM
That was true once; but quite some time ago, it was changed so that either format became acceptable.
11 posts
Location
Austria
Posted 29 August 2015 - 02:22 PM
In the floppy disk's startup, you can add this line:
shell.run("cp disk/Wundows startup")
'shell.run' will execute the string you give it as if you'd run it in the computer's console.
Thenk you very much, this worked perfectly for me! :)/>
I tried shell.run before, but I didn't know it's syntax and i just forgot looking because it was 2AM.
But I'm writing too much, I'm just impressed, by the community in this forum. :)/>
Just thanks for the answer, I'm sure I will enjoy my stay in this forum! ^_^/>
797 posts
Posted 29 August 2015 - 05:30 PM
That was true once; but quite some time ago, it was changed so that either format became acceptable.
Expanding on this, shell.run() joins its arguments with a space, then splits them again, so each argument (mainly the first one) can contain a space and it is split correctly.
While using shell.run() is generally ok, you might want to use fs.move() instead. It works exactly the same, `fs.move( "disk/Wundows", "startup" )`, but doesn't rely on shell running a whole program that does the exact same thing.
8543 posts
Posted 29 August 2015 - 06:12 PM
Rather, fs.copy instead of cp.
11 posts
Location
Austria
Posted 29 August 2015 - 06:23 PM
Rather, fs.copy instead of cp.
I tried that before, but it didn't work, so I used shell.run. Works perfectly too.
But thanks for your answer. ^_^/>