-
-
Notifications
You must be signed in to change notification settings - Fork 233
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
windowsHide: true
does not work when using shell: true
and detached: true
#346
Comments
Hi @rynz, thanks for reaching out. I am assuming you are talking about the new window created by Is your problem:
|
Hi @ehmicky, love this project. My problem is number 2.
and the new window created by |
If an additional Could you try the following?
|
const path = require('path')
const { spawn } = require('child_process')
const run = (args) => {
return new Promise((resolve) => {
const cmd = path.resolve(__dirname, 'foo', 'bar.exe')
const ls = spawn(cmd, args, { shell: true, detached: true, windowsHide: true })
ls.on('close', () => {
resolve()
})
})
}
run(['--test']).then(() => {
console.log('Done')
}) Note: |
I think your code example might be reduced to: const { spawn } = require('child_process')
spawn('./foo/bar.exe', ['--test'], { shell: true, detached: true, windowsHide: true }) Am I correct? Does this still create a window? If I'm correct, please try to remove the Note: this assumes the current directory is the parent directory of |
const { spawn } = require('child_process')
spawn('.\\foo\\bar.exe', ['--test'], { shell: true, detached: true, windowsHide: true }) On Windows, yes window still popping up after UAC prompt. |
Does it still pop up after you remove |
Removing If I run as Administrator with |
To summarize (correct me if I got it wrong):
What about |
To summarise
Therefore, when |
Could this be due to this Node bug? |
Yes, looks related cheers! I'll follow up there. Thanks for taking the time to help! 👍 |
windowsHide: true
does not work when using shell: true
and detached: true
Operating System
Windows 7/8/10
Question
When running
execa
withshell: true
is it possible to optionally hide thecmd
window?Cheers!
The text was updated successfully, but these errors were encountered: