I have a compiled script that works fine. I would like it to "Run as a Service" by this I mean have it automatically run at startup and stay running if the user logs off.
I have followed the instructions for running a program as a service from Microsoft using Sryany.exe and Instsrv.exe.
It is now loaded under services, when I go into Task Manager I can see it running under services, but the program no longer does anything. One thing I rean is that it may not run unless interact with desktop is checked if an Icon is to be displayed in the systray. So I recompiled and tried it again, still nothing. I can start and stop it under services, see it appear and then be removed but the program itself does nothing.
I could understand it failing if some of the dlls it uses are not found on start up. But this is not the case as the first part of the script just moves a file and that portion does not work.
Has anyone loaded a compiled script as a service and had it run properly?
Run as a service
Moderators: JRL, Dorian (MJT support)
Interactive Services not available under Vista
Hi kpassaur,
I have written a Macro Scheduler compiled script that runs as a Srvany service on Windows XP and on Windows Server 2003. For the service to interact with the desktop in any way you must create it as "interactive service". This option is not available under Vista, so you will not be able to do what you want.
Because interactive services will become a thing of the past I decided not to use an interactive service and used a workaround. I wrote a non-interactive service that runs even when all users are logged off and restricted it to things like monitoring processes and sending email alerts. Another compiled script was installed in the user's startup folder (or the all users folder if you want it to run for any user, don't know if this works for Vista's default folder). This compiled script runs as a process and can interact with the user's desktop for the duration of the user's session.
The non-desktop service can run under an account with elevated privileges and can communicate with the desktop process which runs under the likely reduced privileges of the logged on user.
Gale
I have written a Macro Scheduler compiled script that runs as a Srvany service on Windows XP and on Windows Server 2003. For the service to interact with the desktop in any way you must create it as "interactive service". This option is not available under Vista, so you will not be able to do what you want.
Because interactive services will become a thing of the past I decided not to use an interactive service and used a workaround. I wrote a non-interactive service that runs even when all users are logged off and restricted it to things like monitoring processes and sending email alerts. Another compiled script was installed in the user's startup folder (or the all users folder if you want it to run for any user, don't know if this works for Vista's default folder). This compiled script runs as a process and can interact with the user's desktop for the duration of the user's session.
The non-desktop service can run under an account with elevated privileges and can communicate with the desktop process which runs under the likely reduced privileges of the logged on user.
Gale
Run as a service
Gale,
Thanks for your response. It would explain Vista. What I ended up doing and it seems to be working fine is I used a program called "Launcher Service" which is freeware and available at:
Product Details - http://emutastic.emulation64.com/netosoft/projects.htm
Download - http://emutastic.emulation64.com/netoso ... rv_0.2.zip
It saved a ton of hassel as I was writing a script to modify the registry entries to load it as a service and this has a simple ini to edit and a bat file which loads everything and another which will remove everything.
Thanks for your response. It would explain Vista. What I ended up doing and it seems to be working fine is I used a program called "Launcher Service" which is freeware and available at:
Product Details - http://emutastic.emulation64.com/netosoft/projects.htm
Download - http://emutastic.emulation64.com/netoso ... rv_0.2.zip
It saved a ton of hassel as I was writing a script to modify the registry entries to load it as a service and this has a simple ini to edit and a bat file which loads everything and another which will remove everything.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact: