Help me with "child_process.execFile" to run file with query

58 views
Skip to first unread message

nodeusers

unread,
Oct 21, 2014, 2:20:43 AM10/21/14
to nod...@googlegroups.com
Hello!

Please tell me how to call the file with some query. I need to run "D:/PROGRAMS/Dev/App/app.exe" --query 'some search'

Completely confused, and whether, it is possible to make?


Thank you very much.

Ryan Schmidt

unread,
Oct 21, 2014, 1:53:16 PM10/21/14
to nod...@googlegroups.com

On Oct 21, 2014, at 1:20 AM, nodeusers wrote:

> Please tell me how to call the file with some query. I need to run "D:/PROGRAMS/Dev/App/app.exe" --query 'some search'
>
> Completely confused, and whether, it is possible to make?

Did you check the documentation?

http://nodejs.org/api/child_process.html#child_process_child_process_execfile_file_args_options_callback

It says the function's signature is:

child_process.execFile(file, [args], [options], [callback])

It seems like the correct invocation, assuming you don't need any options, would therefore be:

var child_process = require('child_process');
child_process.execFile('D:/PROGRAMS/Dev/App/app.exe', ['--query', 'some search'], callback);

function callback(.....) {
.....
}

nodeusers

unread,
Oct 21, 2014, 2:11:18 PM10/21/14
to nod...@googlegroups.com
Thank you! Yes, i was looked the documentationbut made ​​a mistake in

 exec("D:/PROGRAMS/Dev/Zeal/zeal.exe", ["--query searchText"]

Thank you! Closed -)



вторник, 21 октября 2014 г., 21:53:16 UTC+4 пользователь ryandesign написал:
Reply all
Reply to author
Forward
0 new messages