Subject | Stdout redirection of command line utilities |
---|---|
Author | Zsolt |
Post date | 2012-10-17T13:43:07Z |
Hi,
I can't see my reply to #114922, so I start a new thread on the same observations.
The problem is that the stdout redirection doesn't always work in my case:
fbsvcmgr.exe service_mgr -user SYSDBA -password masterke -info_server_version > test.txt
produces output to test.txt
fbsvcmgr.exe 127.0.0.1:service_mgr -user SYSDBA -password masterke -info_server_version > test.txt
creates an empty output file.
The only solution link to some similar behaviour brings me to http://support.microsoft.com/kb/971163, but I'm not sure if it is really related, yet I haven't tried.
I have observed that only stdout is affected, stderr seems to work.
There is some kind of connection between the phenomenon and my user profile, because logging in with another domain user makes the redirection work for him.
It might also worth mentioning that the issue can also be observed in my case in Delphi 7 as well. If the utility is started from CreateProcess, providing the correct StartupInfo.hStdOutput etc. handles the file represented by the hStdOutput handle remains empty.
Regards
Zsolt
I can't see my reply to #114922, so I start a new thread on the same observations.
The problem is that the stdout redirection doesn't always work in my case:
fbsvcmgr.exe service_mgr -user SYSDBA -password masterke -info_server_version > test.txt
produces output to test.txt
fbsvcmgr.exe 127.0.0.1:service_mgr -user SYSDBA -password masterke -info_server_version > test.txt
creates an empty output file.
The only solution link to some similar behaviour brings me to http://support.microsoft.com/kb/971163, but I'm not sure if it is really related, yet I haven't tried.
I have observed that only stdout is affected, stderr seems to work.
There is some kind of connection between the phenomenon and my user profile, because logging in with another domain user makes the redirection work for him.
It might also worth mentioning that the issue can also be observed in my case in Delphi 7 as well. If the utility is started from CreateProcess, providing the correct StartupInfo.hStdOutput etc. handles the file represented by the hStdOutput handle remains empty.
Regards
Zsolt