Topic: Opening a file having white spaces on is name with the default program


In my rails application, I have a file which name is: "d:/Copy of

I want to open it with the default program.

This file is a TXT file but it can be another kind of file (png, pdf,
etc) and can have, or not, white spaces on his path/name.

I've tried several ways to do it but, until now, I was not able to
accomplish by goal.

I have tried:

f1 = "d:/Copy of t.txt"

#system %{cmd /c "start #{f1}"}
#cmd = 'cmd /c "start ' + f1 + '"'
#cmd = 'cmd /c """start ' + f1 + '"""'
#cmd = "cmd /c ""start '" + f1 + "'"""
cmd = "cmd /c ""start '" + f1 + "'"""

system (cmd)

But no one of these solutions has worked.

Anyone can help me?

Thank you

Best regards