Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not use exec #35

Open
kodypeterson opened this issue Sep 25, 2014 · 7 comments
Open

Can not use exec #35

kodypeterson opened this issue Sep 25, 2014 · 7 comments

Comments

@kodypeterson
Copy link

I am trying to use the following. It works when ran with "node app.js" but not from within the service:

var exec = require('child_process').execFile;
exec("C:\scripts" + req.params.script + ".exe", function(error, stdout, stderr){
console.log(arguments);
});

Any ideas?

@jmorrisIII
Copy link

Did you ever figure this out?

@kodypeterson
Copy link
Author

Nope, still a problem

@jfromaniello
Copy link
Owner

Sorry for the delay, I missed the notification.

I don't know what req.params.script is, and what's the error you get.

Maybe you should write the logs to a file, checkout winston or bunyan

@jmorrisIII
Copy link

I think there is a problem with running an executable from a windows service after XP.

@kodypeterson
Copy link
Author

Yeah, so req.params.script is the location to the executable. So lets just say this is the code failing:

var exec = require('child_process').execFile;
exec("C:\scripts\test.exe", function(error, stdout, stderr){
console.log(arguments);
});

@deliverymanager
Copy link

Did you manage to figure this problem of the exec command not working to a .exe file?

@JBarna
Copy link

JBarna commented Apr 27, 2016

I found a reason for this problem at this link. Turns our you can't create processes from windows services anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants