Issue while running system commands inside Sketchup ruby extension , in Windows VM running with Parallels on Mac

In my Sketchup ruby extension, I have to run certain system commands (like running another .exe).
For this purpose, in ruby script, I create a batch file and write the command into it.

To run the batchfile I used the following syntax.

batchPath = “path_of_batch_file”

`cmd /c #{batchPath}`

This command runs fine in most windows machines. But in a Mac book, which has a Windows 7 VM installed on it using Parallels, this command does not run. Even in the mac book, it is running fine in Sketchup 2015. But the problem occurs only when running the ruby extension in Sketchup 2016 , in the specific PC.

Apart from using Backticks, I have tried other ways of running batch files from ruby namely,

system(“cmd /c #{batchPath}”)

%x[“cmd /c #{batchPath}”]

UI.openURL(‘file:///’+batchPath)

Only the last option, UI.openURL works in the above specified PC ( Sketchup 2016 in Windows VM on Mac).

Is there any change in how command line commands are to be handled, with respect to Sketchup 2016 ?
Or is it something related to accessing system commands in a VM ?

See:
SketchUp Hardware and Software Requirements > Unsupported Environments — SketchUp Help

1 Like