Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

system function doesn't show console window in Vista window servic

1 view
Skip to first unread message

LT Khoo

unread,
Aug 13, 2008, 3:26:12 AM8/13/08
to
Hello everybody,

I had a window service program that invokes command scripts from bat/cmd
files using the C function "system", compiled using Visual Studio 2005. When
the scripts are invoked in Windows 2000, console windows pop up and
disappear. Though a little annoying, these windows helps a lot when an error
happens as the window will stay on.
In Vista, there is no console window at all thus it is difficult to tell an
error in the scripts. Is there a setting somewhere in Vista that disable the
console ?
I have tried another function "spawn" but it doesn't work either.
Is there a function that will bring up the console even in Vista window
service ?
Please help.

ltkhoo

Alex Blekhman

unread,
Aug 13, 2008, 4:06:45 AM8/13/08
to
"LT Khoo" wrote:
> I had a window service program that invokes command scripts from
> bat/cmd files using the C function "system", compiled using
> Visual Studio 2005. When the scripts are invoked in Windows
> 2000, console windows pop up and disappear. [...]

> In Vista, there is no console window at all thus it is difficult
> to tell an error in the scripts. Is there a setting somewhere in
> Vista that disable the console ?

Starting with Windows Vista the logon session 0, which is used to
run services, is completely isolated form any GUI facilities.
Interacting with user's desktop from service considered to be
unsafe and constitutes a security risk. You will need to develop
some kind of interaction protocol between the servioce and
currently logged user session. Alternatively, you can mainatan
detailed log file within the service.

For more info about services under Vista read here:

"Services in Windows Vista"
http://go.microsoft.com/fwlink/?LinkId=71280

Pay attention to "Session 0 Isolation" section.

HTH
Alex


0 new messages