Jump to content




Floppy Disk >> Computer

help command computer

9 replies to this topic

#1 _mika99_

  • Members
  • 11 posts
  • LocationAustria

Posted 29 August 2015 - 12: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

#2 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 29 August 2015 - 01: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


#3 _mika99_

  • Members
  • 11 posts
  • LocationAustria

Posted 29 August 2015 - 01: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 :)

#4 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 29 August 2015 - 05: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.

#5 Twijn

  • Members
  • 119 posts

Posted 29 August 2015 - 05:48 AM

View PostHPWebcamAble, on 29 August 2015 - 05:17 AM, said:

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")


#6 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 29 August 2015 - 06:29 AM

That was true once; but quite some time ago, it was changed so that either format became acceptable.

#7 _mika99_

  • Members
  • 11 posts
  • LocationAustria

Posted 29 August 2015 - 01:22 PM

View PostHPWebcamAble, on 29 August 2015 - 05:17 AM, said:

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! ^_^

#8 Exerro

  • Members
  • 800 posts

Posted 29 August 2015 - 04:30 PM

View PostBomb Bloke, on 29 August 2015 - 06:29 AM, said:

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.

#9 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,451 posts

Posted 29 August 2015 - 05:12 PM

Rather, fs.copy instead of cp.

#10 _mika99_

  • Members
  • 11 posts
  • LocationAustria

Posted 29 August 2015 - 05:23 PM

View PostLyqyd, on 29 August 2015 - 05:12 PM, said:

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. ^_^





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users