# proc_open with bypass_shell problems

- Thread: https://externals.io/message/42933
- Original archive: https://news-web.php.net/php.internals/42933
- Started by torokalpar@gmail.com on 2009-02-05T11:45:01+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #42933 — torokalpar@gmail.com — 2009-02-05T11:45:01+00:00

URL: https://externals.io/message/42933#42933

Hi,

Let me start by explaining what i am trying to do. I need to start a console
application and get it's pid. If i don't use bypass_shell, i end up with the
another pid (probably one for cmd.exe). If i use bypass_shell then the
application starts in the background, no window is shown. This would be
great, if this wouldn't prevent the application from generating soem logs. I
have looked into the sources and found that my problem might be here:

newprocok = CreateProcess(NULL, command, &security, &security, TRUE,
NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env.envp, cwd, &si, &pi);

Why is the CREATE_NO_WINDOW necesarry? Might this be the problem? I am not a
win expert, i lean mroe towards *nix.  Is there any option to start
direclty, but show the window, and let the application perform as usual?

PS: hope it's the right list
-- 
Alpar Torok

---

## #42934 — Richard Quadling — 2009-02-05T11:50:00+00:00

URL: https://externals.io/message/42933#42934 · In reply to: #42933

2009/2/5 Alpár Török <torokalpar@gmail.com>:
> Hi,
>
> Let me start by explaining what i am trying to do. I need to start a console
> application and get it's pid. If i don't use bypass_shell, i end up with the
> another pid (probably one for cmd.exe). If i use bypass_shell then the
> application starts in the background, no window is shown. This would be
> great, if this wouldn't prevent the application from generating soem logs. I
> have looked into the sources and found that my problem might be here:
>
> newprocok = CreateProcess(NULL, command, &security, &security, TRUE,
> NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env.envp, cwd, &si, &pi);
>
> Why is the CREATE_NO_WINDOW necesarry? Might this be the problem? I am not a
> win expert, i lean mroe towards *nix.  Is there any option to start
> direclty, but show the window, and let the application perform as usual?
>
> PS: hope it's the right list
> --
> Alpar Torok
>

If you bypass the shell, then there is no window. The shell IS the window.




-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
