[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 973
  • Last Modified:

How to delay nt autologin or delay service

The problem I have is I have an nt server 4.0 machine set to login automatically.  The problem is one of my 3rd party applications service fails at startup right after login.  The reason for this is the nt services have not fully started up and this application depends on the nt services to start before it can start.  IF I disable auto login the application service starts fine, this is because you get the login prompt now and it gives you an extra few secondsfor the nt services to start before my application services start.  I need to have autologin enabled though, this is just how they want it.  I tried the article "how to delay loading of specific services" Article - 193888 from microsoft, but the instructions to edit and add a value, etc are not an option when I go to services in the registry.  It says to add a new value name Depenonservice with data type of reg_multisz, but there is no option to pick a data type of that type.  I am using regedit, am I using the right registry editor?  Is there any way to delay this service at startup or to delay the autologin by a few seconds so it give the nt services time to start before my applications services start?
0
Janice1967
Asked:
Janice1967
  • 3
  • 2
  • 2
  • +1
1 Solution
 
YarnoSGCommented:
you are using the WRONG registry editor.

(not an issue in XP, but the registry editors have different capabilities in 2000 and Prior NT Based OSes.)  To generate a REG_MULTI_SZ in 2000 or NT4, you need to be using REGEDT32.
Reference http://support.microsoft.com/default.aspx?scid=kb;EN-US;141377
and an article I wrote 4+ years ago: http://www.winnetmag.com/Article/ArticleID/14738/14738.html
0
 
YarnoSGCommented:
oh, and the article you had before will work if you use the right editor.....
0
 
Janice1967Author Commented:
Thanks,
I will try this.  I think the startup file that is failing at atartup is not a service now.  It is a .exe file that is failing. It is located in c:\winnt\profiles\all users\programs\start menu\startup\XXX.exe.  When I go into task manager I see XXX.exe and a PID for it.  It is not listed in the services in Windows nt diagnostics, does this mean it is not a service? If it is not a service then I cannot use the article I mentioned above.  If it is not a service how can I delay this file from running until all the nt services have started.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
jzanetteCommented:
You could put the startup commands in a script and then use

   CALL ntlib.cmd /init
   %.Wait% [SecondsToWait]
   YourExeHere

*******

The Advanced Command Library (ntlib.cmd) is free at http://ntlib.com, and includes the .Wait command used in the example.

ntlib.cmd contains NO BINARY CODE, just shell scripting commands.  It runs CONSISTENTLY on NT4SP6a+, 2000, XP and Server 2003.

0
 
averybCommented:
If you have access to WinNt Server Resource Kit there are two files you need.  InstSrv.Exe and SrvAny.exe  These two files will let you install any exe as a Service.  

MS Knowledge Base Article 137890

It is rock-solid, and I have used it extensively.
0
 
averybCommented:
You could also use sleep.exe form the Resource Kit.  Make a bat file that calls your exe file and enter sleep 30 on the line before the exe command.  That will cause a 30 second pause in the bat file before the next line is read in the bat file.

Using Instsrv and Srvany is a much more elegant way.
0
 
Janice1967Author Commented:
I created a batch file which called my .exe file and entered sleep 7.  It worked perfectly.  
0
 
averybCommented:
Glad it worked.  Using srvany and instsrv will allow you to control the program like a regular NT service from the control panel, services applet or the cmd line.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now