General discussion

how to change starting order of a windows service?

I have a program called Gmote on my phone, that acts as a wireless remote for windows. It works over wifi, where a server is installed on a windows XP machine. It is my goal to use this program to replace my keyboard / mouse of my meda PC in the living room. I can use the program great within windows, but am unable to input my password at the logon screen,as obvioulsy Gmote is not running at this time. So my question is how do I get a program to run before the login screen?

I have spent many hours trying to accomplish this, and have figured if I want Gmote to be available at the logon screen I will have to setup Gmote as a windows service. I seem to have done this successfully by following the below steps:

1.Run SrvInstw.exe
2.Check Install Service radio box, click Next
3.Check Local Machine radio box, click Next
4.Enter the name for your service, click Next
5.Click Browse and select srvany.exe (which is in the same folder as SrvInstw.exe, remember?), then click Next
6.Click Service is its own Process radio box, click Next
7.Select what user account you want this service to run under. If this service is to have its UI, check the Allow Service to Interact with Desktop checkbox. Normally the services run under System Account
8.Select the startup option, click Next
9.Click Finish. But you are not finished just yet
10.Open RegEdit. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
11.Locate the service you just created in the Services branch, click on it.
12.Create a new key called Parameters
13.Click on Parameters and create a new string value called Application
14.Double-click on Application and set it equal to the full path of your VB executable (e.g. c:\...\MyApp.exe)

My only problem now is that Gmote seems to be starting before my wirless network is configured and comes up with an error message:

?unable to join the multicast socket. Is the computer connected to a network? Exiting Gmote.?

Once the wireless network is configured if you close this warning box everything works as it should. Even with the warning box open the file browser works but not the touchpad. The problem is I can?t close this box without a mouse or keyboard, so defeats the object of having my media centre pc solely controlled from my phone.

I looked into adding dependencies to my Gmote registry service key, as I thought this may rectify the problem. The dependencies I have added are RpcSs, Ndisuio, WZCSVC, Ip6Fw, Dhcp, Tcpip, Afd, NetBT (this are the logical ones I could think of)

Despite this Gmote still starts before my wireless network adapter is configured, so I always get the error message. Is there anyway to make sure Gmote only starts once my wireless network is configured?

Discussion is locked

Follow
Reply to: how to change starting order of a windows service?
PLEASE NOTE: Do not post advertisements, offensive materials, profanity, or personal attacks. Please remember to be considerate of other members. If you are new to the CNET Forums, please read our CNET Forums FAQ. All submitted content is subject to our Terms of Use.
Reporting: how to change starting order of a windows service?
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Comments
- Collapse -
Changing start order will not cure this.

Now that you wrote all that out, I hope you see this is not a start order issue. In fact it's not even a service issue. It's simpler that that.

Your Gmote software needs to be fixed to handle this issue. I know this because I had to add this condition to my apps.

Again it's not a service order issue. The wifi services and more can all be up but that is not an indication we have an internet connection.

AGAIN, all the services can be UP, RUNNING, YET there is no network built up yet.

Bottom line? Fix your gmote software.
Bob

- Collapse -
further question

I understand what you are saying but if I can dealy Gmote startup long enough then the network will get built up and everything will be ok (say 1 minute). I know the Gmote software needs fixing, however are there any tricks in windows to enable me to dealy it's startup long enough for the internet connection to be up and running (say 30 seconds to 1 min)?

Thanks Adam

- Collapse -
Since it's XP

Also I may be reading more in your post than you wrote. I thought this was your software. For example when I write "my software" I really mean it since I write apps for embedded machines, Windows, Windows Mobile, PalmOS and the list goes on and on.

Now I see that this is just an app you acquired.

The usual workaround is this:

1. Don't set the service to start.
2. Autologon and in the startup group put your .bat file with...

A choice or a PING command of the right delay for your needs.
And the NET START command to manually start the service.

Yes you could write an app to start the service when the network comes up but that's up to you to write.
Bob

- Collapse -
problem with your suggestion

No it's not my software, I am just tying to get things working!

I have never written a batch file before but have been looking into this and it seems this won't work because it needs me to already login to windows. I want everything to be configured before the logon screen.

I can already get the program to run once in windows by having WZCSVC (Wireless Zero Configuration Service) run as a service and then running Gmote just in the startup menu (instead of a service). This way the wireless network is configured before Gmote attempts to lanuch. My issue is trying to get Gmote to configure after the wireless zero config service so that I can use it to longin to windows. At the moment when running this as a service it starts before the wireless network and so produces an error.

Thanks Adam

- Collapse -
Then back to the app's author.

That's either a feature request or a bug report. Since you can't write a batch file you may have to wait for them to fix their app. I know I have to when this happens.

Again no way any service start order will fix this because it's not a service order or start issue. The wifi network services will start just fine but this app depends not on the service but that the wireless network have obtained it's IP and more.

I know this seems deep but you did wander into a deeper end of the pool.
Bob

- Collapse -
what about writing a batch file

Ok no problem. I have looked around and it seems there is no way to make a batch file run before windows logon. Do you know if there is a way to run another service that may interfere with Gmote loading or causing it to crash? This way I would have more time for the wireless network to obtian an ip address, before the program starts again. I only need to delay it's start for a few seconds as on a few occasions my wireless network has been able to obtian an ip before Gmote has loaded.

- Collapse -
Putting my programmer hat on.

Be warned, switching to programmer's hat.

http://msdn.microsoft.com/en-us/library/d56de412(VS.80).aspx shows we need Visual Studio Pro to write a service.

http://msdn.microsoft.com/en-us/library/zt39148a(VS.80).aspx is a walk through to create our service in all the languages.

http://stackoverflow.com/questions/2255335/how-to-runf5-windows-service-from-visual-studio shows that to start the service (Gmote) is done with the service.OnStart() method.

So there it is. For about 500 bucks and a little work I think a programmer could craft you this new service in about 1/2 a day. However finding such a programmer may be the tough part. Most of them want pay for this. At the rate around here that small app to fix Gmote's bug looks to cost 600 bucks.

--> This is why I suggest you contact of the author of Gmote.

Since you dismissed the login startup batch file and maybe did not research services that could use a batch file or the scheduler (big hint!!!) this means that we are wading farther into the deep end of the pool.
Bob

- Collapse -
what about another way

Ok so lets look at this from another way. I have written a simple batch file that controls the delay in starting Gmote, so everything works fine once you are logged into windows. As you know my problem is I can't run Gmote at the logon screen because the batch file has not been executed by this time, and if I run Gmote as a service it loads too quickly and gives an error. In light of this do you know if there is a 3rd party password / login utility that will load on windows startup, so I can just disable the normal logon screen? This way I will be in windows so my batch file will run and then I will be able to use Gmote. I really don't like the computer booting straight to my files without the need for a password. I don't even care if the password utility is a bit lame, as it is just to stop kids / messing about with the computer. I seem to remember some program like this in the days of windows 95, although I can't remember what?

Thanks Adam

- Collapse -
See below.

But Startup delayer is nothing more than what we do ourselves with the batch file.

-> But I think you missed it when you said it failed with GMote as a service. I WROTE TO SET GMOTE'S SERVICE to "MANUAL START" so our batch file could use NET START after a delay or a test that the network was up.

This seems a shame to jump all through these hoops when the app's author could add this feature in 10 to 20 lines of code.

QUESTION: Have you asked the author?

BONUS: All this is great stuff. This is how I see most folk learn how to get their machines to do what they want.

UGLY WORKAROUND: Let's say I auto-login and have it use the old batch files. What stops me from having an account called GMOTER that auto-logs in, runs my script or bat file (the delay, test, NET START GMOTE) and then ONE MORE LINE to log out?

And what about SCHEDULER? XP's TASK SCHEDULER can schedule a batch file which can have your script to start the service at a later time. This has an extra bonus that if the wifi network goes down, it will come back up automatically later. Your script can determine that. Example:
http://www.google.com/search?hl=en&q=xp+task+scheduler+hourly

Bottom line. As we discovered the start order of the services is not going to fix this. The services will start just fine but the wifi service will be up, running but no IP addresses so GMOTE fails again. The need changes from the original request to "how do I fix that?" and the answer is to find a solution that (a) works and (b) you can implement. This is still a feature to ask the author of GMOTE for.

Hope this helps,
Bob

- Collapse -
I have developed a workaround, but still have a small prob

I have been playing around for a while and have had some success in developing a workaround. I have written a very simple batch file delaying the start of Gmote for 30 seconds on system boot. This is long enough for my wireless service to return an ip address every time, So I no longer get the errors. So that the batch file fully executes I have done away with the windows logon, and boot directly to the operating system. Instead I have found a password protected screensaver that kicks in when windows loads. This also prevents system hotkeys such as Ctrl+ alt + del being used to bypass the screensaver, as well as employing mechanisms to stop the user turning the system off and booting into safe mode. As this program provides a lock screen within windows, background loading processes are unaffected, thus meaning the batch file executes correctly and Gmote loads. The only thing I would like to change is the fact that before the lock screen kicks in, the desktop is visible for around 2 seconds when booting up. Is there anyway to get the password protected screensaver program to kick in immediately on windows boot, without the desktop being visible for 1 -2 seconds?

thanks for your help

- Collapse -
We've covered this.

Or rather we covered solutions that don't have us log in.

About the 1-2 seconds. You have other solutions above that avoid the log in.

--->>> I see that this as SOLVED. Why anyone would fret about the 1-2 seconds is not known.
Bob

- Collapse -
Maybe this?
- Collapse -
You might try Service Control Manager ...
- Collapse -
I have developed a workaround but still have a small problem

I have been playing around for a while and have had some success in developing a workaround. I have written a very simple batch file delaying the start of Gmote for 30 seconds on system boot. This is long enough for my wireless service to return an ip address every time, So I no longer get the errors. So that the batch file fully executes I have done away with the windows logon, and boot directly to the operating system. Instead I have found a password protected screensaver that kicks in when windows loads. This also prevents system hotkeys such as Ctrl+ alt + del being used to bypass the screensaver, as well as employing mechanisms to stop the user turning the system off and booting into safe mode. As this program provides a lock screen within windows, background loading processes are unaffected, thus meaning the batch file executes correctly and Gmote loads. The only thing I would like to change is the fact that before the lock screen kicks in, the desktop is visible for around 2 seconds when booting up. Is there anyway to get the password protected screensaver program to kick in immediately on windows boot, without the desktop being visible for 1 -2 seconds?

thanks for your help.

- Collapse -
use task scheduler

I have got gmote working as I want by using the task scheduler in xp. I removed gmote from the startup folder where it was originally and then added it as a scheduled task with the following options:
run only if logged on
scheduled task = once
start time I set for 2 mins from now
advanced: repeat task every 1 minutes

then I also setup xp to logon automatically (do a search for control userpasswords2 if you don't know how).

at the specified time in 2 mins gmote server starts up and once running the task scheduler seems to know not to try and relaunch it. If I restart my computer then it logs on to xp automatically and then in a minute or less gmote relaunches, simples! I do note however that if I suspend my computer then when I turn it back on it comes up with the xp login screen even though I have no password set and although the gmote server is still running it won't let me have control till after the log on screen so I have to drag my fat *** across the room and press enter on my keyboard. Alternatively I can just shut down the computer rather than suspending?

CNET Forums

Forum Info