Run command

In a button script, I use the _run command.
_run "D:\SomeExe.exe D:\Temp\FiletoProcess.txt"
No problem.

Problem starts with spaces in the file name.
Then we need to enclose the file name in quotes.

Could look like:
_run “D:\SomeExe.exe” "D:\Temp\File to Process with spaces.txt"
Can’t work because of the space between executable’s name and the parameter.

_run "D:\SomeExe.exe D:\Temp\File to Process with spaces.txt"
Works in Rhino, but not for the executable.
The parameter must be enclosed in quotes, as Windows does.

The quotes can only be left out for filenames with no spaces.



Double double quotes should work… or?

_Run ""D:\SomeExe.exe D:\Temp\File to Process with spaces.txt""


No, doesn’t work.

This also not:
_Run ““D:\SomeExe.exe” “D:\Temp\File to Process with spaces.txt””

I think this will never work with the _run.
Now I will try with the shell object.

I will report.

Dunno, the following seems to work for me, only single double quotes:

_Run "C:\Windows\Notepad.exe D:\Desktop\Hello World.txt"


Seems my executable is too dense then…

Ok, have it working without the _run command:

Dim ws
Set ws = createobject("")
C2 = chr(34) & FullExePath & chr(34) & chr(32) & chr(34)  & DTFolder & "\" & TempFile & chr(34)
ws.exec c2
set ws=nothing

Works exactly as expected.

Anyway, thank you Mitch.