更新时间:2023-10-25 18:02:10
这应该有效(未经测试,因为我现在不在Windows计算机上):
This should work (untested, as I'm not on a Windows machine now):
file_to_open = "c:\path\to\file.txt"
system %{cmd /c "start #{file_to_open}"}
作为参考,这也可以在OS X上完成:
For reference, this can also be done on OS X:
file_to_open = "/path/to/file.txt"
system %{open "#{file_to_open}"}