Link to home
Start Free TrialLog in
Avatar of marcjb
marcjbFlag for United States of America

asked on

Creating a service not in the taskbar

Hello All,

I have a DOS program that does some file processing and also writes to a logfile that is currently running as a service.  The problem I have is that a blank minimized DOS window shows up in the taskbar, and the client can terminate the program by closing this window.

Is there a way to make it so that the program either does not appear in the taskbar or can't be closed just by clicking the X in the top right corner?  Also, what signal is sent to a program when the X is clicked?

Thanks for your help,

Marc
ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of marcjb

ASKER

Sorry, but I do not normally work on Windows.  Is this a VB script?

Also, if my program (file.exe in your example) exits normally, how would the OS know so that it would restart the calling script?

Marc
Yes, it's vb scripting.  You save it as 'whatever'.vbs and run 'it' instead of your program...

Not sure what you mean by restarting the calling script.  Can you provide more detail on what the program does?
Avatar of marcjb

ASKER

The program looks for certain files, processes them, and in the meantime may write to a logfile.  If certain errors occur, it systems out and invokes a GUI warning screen for the user to see.

The problem we had was that because the GUI screen needs to interact with the desktop, we wrote a small batch script (.bat file) to kick off our executable.  This unfortunately means that the .bat file command window stays around.  One user went ahead and closed this window, and this terminated our application.

Basically, we need to be able to kick off a DOS based program that can in turn system out to launch a GUI program (splash screen with messages).  We don't want the user to see that the DOS program is running (because they could then kill it), and we would prefer if the DOS app worked like a service so that if it does exit for some reason it is restarted.

Marc
There's a few ways to possibly counter this...though without knowing the app, I can't say which one will work for you...

In the script, with
   objShell.Run strCommand, True
then the run method should return any error code returned by the application.

Otherwise, you may consider a (free) product called srvany to install this app as a service (though again, I can't say it will work for you 100%).
Avatar of marcjb

ASKER

I will these ideas and let you know how they work out.
Avatar of marcjb

ASKER

We have decided to go a different way, but I wanted to thank you for your time.

Marc