DOS cmd from .rb file


#1

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


#2

Like this?:

ans = %x[dir]
puts ans

Then take a look at:

  • %x

  • system()

  • exec()

  • ``

  • Axel


#3

system(“dir”)

or

result=dir

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