DOS cmd from .rb file

hi all, i try to invoke some DOS cmd from .rb file but to no avail.
Anyway, can i do that?

Like this?:

ans = %x[dir]
puts ans

Then take a look at:

  • %x

  • system()

  • exec()

  • ``

  • Axel

system(“dir”)

or

result=dir

In the second example those are back ticks (left of the 1 key) not
single quotes.