Pass command to external program and wait for results

Does DOpus have a RunWait syntax like the AHK? Or is the default RunWait?

RunWait es " " arg " -export-txt " A_Temp "\es-output.txt", , "Hide"
var cmd = DOpus.Create.Command();
 cmd.addline('C:\\Program Files\\Everything\\es.exe -dm -size -full-path-and-name -sort-date-modified test -export-txt D:\\test.txt')

If you just need to wait for the program to finish, add @sync: at the start of the line that runs it.

You're also missing quotes around the es.exe path, since it contains spaces:

cmd.addline('@sync:"C:\\Program Files\\Everything\\es.exe" -dm ...etc...')

If you also need the program's exit code, the WScript.Shell Run or Exec methods can get it:

I got an error when I tried WScript.Shell.
I use DOpus.Output() to output.

You haven't shown us how you're using it, so I can only guess, but it looks like you haven't created the object properly.

Did you look at the examples in the other thread?

Forget it. I'm just a rookie.